After upgrading from Struts 2.0.x to 2.2.x, static content no longer served...
I recently upgraded from Struts 2.0.x + SmartURLs to Struts 2.2.1 + Convention plugin. However after upgrading all my static content is no longer being served. I read all the release notes along the way that I could find and nothing suggests that my old approach should have stopped working. Can anyone point out what else I need to change/tweak to get static content behaving again? I'm using Maven as the build system. static content is at src/main/webapp/css /javascript /template /WEB-INF Here are my filters from web.xml filter filter-namestruts-cleanup/filter-name filter-classorg.apache.struts2.dispatcher.ActionContextCleanUp/filter-class /filter filter filter-namesitemesh/filter-name filter-classorg.apache.struts2.sitemesh.FreemarkerPageFilter/filter-class /filter filter filter-nameSpring OpenEntityManagerInViewFilter/filter-name filter-classorg.springframework.orm.jpa.support.OpenEntityManagerInViewFilter/filter-class /filter filter filter-namestruts/filter-name filter-classorg.apache.struts2.dispatcher.FilterDispatcher/filter-class /filter filter-mapping filter-namestruts-cleanup/filter-name url-pattern/*/url-pattern /filter-mapping filter-mapping filter-namesitemesh/filter-name url-pattern/*/url-pattern /filter-mapping filter-mapping filter-nameSpring OpenEntityManagerInViewFilter/filter-name url-pattern/*/url-pattern /filter-mapping filter-mapping filter-namestruts/filter-name url-pattern/*/url-pattern /filter-mapping Here's the root node and contents of the struts.xml: struts constant name=struts.objectFactory value=spring / constant name=struts.devMode value=true / constant name=struts.action.extension value= / constant name=struts.convention.default.parent.package value=cib-default / package name=cib-default extends=struts-default interceptors interceptor name=reattachment class=com.ballroomregistrar.compinabox.online.web.interceptors.WebSessionReattachmentInterceptor / interceptor name=authentication class=com.ballroomregistrar.compinabox.online.web.interceptors.AuthenticationInterceptor / interceptor name=authorization class=com.ballroomregistrar.compinabox.online.web.interceptors.AuthorizationInterceptor / interceptor-stack name=cibStack interceptor-ref name=reattachment / interceptor-ref name=authentication / interceptor-ref name=authorization / interceptor-ref name=defaultStack / /interceptor-stack /interceptors default-interceptor-ref name=cibStack / global-results result name=login type=redirect/account/login/result result name=access_denied type=redirect/accessDenied/result /global-results /package /struts - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Using FreeMarker (or Velocity) to template emails sent by a struts2 app?
Is there a good/standard way to use FreeMarker (or Velocity) to template emails sent by a Struts2 application? I hacked up something that works, but my solution doesn't know about struts2, so it can't use the taglibs to produce URL. (Ie sending an email for a new account with an activation link). I have to assume this is something everyone has to do, so maybe I'm just overlooking something obvious. Thanks. Eric - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
After upgrading from Struts 2.0.x to 2.2.x, static content no longer served...
I recently upgraded from Struts 2.0.x + SmartURLs to Struts 2.2.1 + Convention plugin. However after upgrading all my static content is no longer being served. I read all the release notes along the way that I could find and nothing suggests that my old approach should have stopped working. Can anyone point out what else I need to change/tweak to get static content behaving again? I'm guessing its related to my have a action extension? I'm using Maven as the build system. static content is at src/main/webapp/css /javascript /template /WEB-INF Here are my filters from web.xml filter filter-namestruts-cleanup/filter-name filter-classorg.apache.struts2.dispatcher.ActionContextCleanUp/filter-class /filter filter filter-namesitemesh/filter-name filter-classorg.apache.struts2.sitemesh.FreemarkerPageFilter/filter-class /filter filter filter-nameSpring OpenEntityManagerInViewFilter/filter-name filter-classorg.springframework.orm.jpa.support.OpenEntityManagerInViewFilter/filter-class /filter filter filter-namestruts/filter-name filter-classorg.apache.struts2.dispatcher.FilterDispatcher/filter-class /filter filter-mapping filter-namestruts-cleanup/filter-name url-pattern/*/url-pattern /filter-mapping filter-mapping filter-namesitemesh/filter-name url-pattern/*/url-pattern /filter-mapping filter-mapping filter-nameSpring OpenEntityManagerInViewFilter/filter-name url-pattern/*/url-pattern /filter-mapping filter-mapping filter-namestruts/filter-name url-pattern/*/url-pattern /filter-mapping Here's the root node and contents of the struts.xml: struts constant name=struts.objectFactory value=spring / constant name=struts.devMode value=true / constant name=struts.action.extension value= / constant name=struts.convention.default.parent.package value=cib-default / package name=cib-default extends=struts-default interceptors interceptor name=reattachment class=com.ballroomregistrar.compinabox.online.web.interceptors.WebSessionReattachmentInterceptor / interceptor name=authentication class=com.ballroomregistrar.compinabox.online.web.interceptors.AuthenticationInterceptor / interceptor name=authorization class=com.ballroomregistrar.compinabox.online.web.interceptors.AuthorizationInterceptor / interceptor-stack name=cibStack interceptor-ref name=reattachment / interceptor-ref name=authentication / interceptor-ref name=authorization / interceptor-ref name=defaultStack / /interceptor-stack /interceptors default-interceptor-ref name=cibStack / global-results result name=login type=redirect/account/login/result result name=access_denied type=redirect/accessDenied/result /global-results /package /struts - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Using FreeMarker (or Velocity) to template emails sent by a struts2 app?
Is there a good/standard way to use FreeMarker (or Velocity) to template emails sent by a Struts2 application? I hacked up something that works, but my solution doesn't know about struts2, so it can't use the taglibs to produce URL. (Ie sending an email for a new account with an activation link). I have to assume this is something everyone has to do, so maybe I'm just overlooking something obvious. Thanks. Eric - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: After upgrading from Struts 2.0.x to 2.2.x, static content no longer served...
Li Ying wrote: Are your setting: constant name=struts.action.extension value= / ? Yes, I was intentionally setting the extension to the empty string. This used to work under the SmartUrls plugin in 2.0.x days. I've dug though and found the comments in his source about how the author made that work. First switched to using action as the extension and all the filter mappings to *.action -- things worked again, but had urls of a form I don't prefer. Started to port the SmartURL changes into a custom subclass of FilterDispatcher -- and noticed that its deprecated and I should have used the StrutsExecuteFilter and StrutsPrepareFilter instead. Abandoned the port and switched to the correct filters and the empty extension. Static content worked again. Changed some jsps, restarted server -- static content stopped working, very confused. Switched to the , value you suggested in the followup email and that seems to have fixed the static content again, but something broke the taglibs. Started getting the According to TLD or attribute directive in tag file, attribute href does not accept any expressions error but I'm using the correct tag lib: %@ taglib uri=http://java.sun.com/jsp/jstl/core;prefix=c % %@ taglib uri=/struts-tags prefix=s % and this was working fine before. Dug deeper trying to see if I had missed other filter/servlet changes over the past couple of years, and yes I had. Tried following the directions on: http://struts.apache.org/2.x/docs/sitemesh-plugin.html but can't seem to figure out how to combine that with spring -- If I don't use the Struts Listener Freemarker won't start; if I don't use the Spring listener none of my beans get injected. Can't seem to use both. I'm currently Googling trying to find example/tutorials using Struts 2.2.x, Spring, Sitemesh, and Freemarker, but so far all are either pre 2.1.6 (the new style fitlers) or leave off either spring or sitemesh. If anyone can point out a good, modern tutorial/guide that deals with Struts 2.2, Spring, Sitemesh, Freemarker, (and Hibernate) that would be wonderful. I feel like I'm currently fixing one thing, while breaking another... Thanks. Try delete it, use the default setting instead. I take a quick look of the struts source code. In [org.apache.struts2.dispatcher.mapper.DefaultActionMapper], it use the extension of request url to detect if this request should be mapped to an Action. If you set this constant to , then DefaultActionMapper will map all the request to Action. You can read the source of method [getMapping]/[dropExtension]/[dropExtension] for more information. On Mon, Oct 18, 2010 at 4:25 PM, Eric Nielsen ericdniel...@gmail.com wrote: I recently upgraded from Struts 2.0.x + SmartURLs to Struts 2.2.1 + Convention plugin. However after upgrading all my static content is no longer being served. I read all the release notes along the way that I could find and nothing suggests that my old approach should have stopped working. Can anyone point out what else I need to change/tweak to get static content behaving again? I'm guessing its related to my have a action extension? I'm using Maven as the build system. static content is at src/main/webapp/css /javascript /template /WEB-INF Here are my filters from web.xml filter filter-namestruts-cleanup/filter-name filter-classorg.apache.struts2.dispatcher.ActionContextCleanUp/filter-class /filter filter filter-namesitemesh/filter-name filter-classorg.apache.struts2.sitemesh.FreemarkerPageFilter/filter-class /filter filter filter-nameSpring OpenEntityManagerInViewFilter/filter-name filter-classorg.springframework.orm.jpa.support.OpenEntityManagerInViewFilter/filter-class /filter filter filter-namestruts/filter-name filter-classorg.apache.struts2.dispatcher.FilterDispatcher/filter-class /filter filter-mapping filter-namestruts-cleanup/filter-name url-pattern/*/url-pattern /filter-mapping filter-mapping filter-namesitemesh/filter-name url-pattern/*/url-pattern /filter-mapping filter-mapping filter-nameSpring OpenEntityManagerInViewFilter/filter-name url-pattern/*/url-pattern /filter-mapping filter-mapping filter-namestruts/filter-name url-pattern/*/url-pattern /filter-mapping Here's the root node and contents of the struts.xml: struts constant name=struts.objectFactory value=spring / constant name=struts.devMode value=true / constant name=struts.action.extension value= / constant name=struts.convention.default.parent.package value=cib-default / package name=cib-default extends=struts-default interceptors interceptor name=reattachment class=com.ballroomregistrar.compinabox.online.web.interceptors.WebSessionReattachmentInterceptor / interceptor name
Re: S2: s:include tag and s:param
So I tried the param. access path last night. That wasn't working, the documentation referenced a parameters. instead. I managed to get that working with s:component, but no luck with s:include. I don't really care if I use component versus include; however I liked the include slightly better since I was easily able to place my jsp fragment/component underneath WEB-INF. When I tried using struts.ui.templateDir to move the template directory used by s:component under WEB-INF, it appears to break all the regular struts 2 tags. Is there a good way of locating application custom templates underneath WEB-INF without breaking the search path for the existing tag/themes? Eric - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: S2: s:include tag and s:param
Dave Newton newton.dave at yahoo.com writes: It already does; not sure what I was thinking there. (I do know; I was looking at the wrong code.) I'm able to access parameters set via a nested s:param.../ using both c:out value=${param.foo}/ and ${param.foo}. If the value is coming from the action then you shouldn't even need to set it via an s:param.../ since the value stack is available in included pages--action properties are available via both S2 tags and EL (via the custom request hoobie-doobie). OK I'm now a little confused. It sounds like you're reversing yourself from the first reply and that what I was trying should work? Can you see something different between your test case and the code I sent before? I can't use use the action's properties, since different actions back the different views that use this snippet. In all cases the needed property is navigateable from exposed properties, however. Hence the desire to use the include to effectively rename the property from the main result jsp to the included snippet. Eric - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]