Do you need the StaticFilter? Do you plan on having static *.html files in your project? If you're using Dojo, you might need it, but otherwise you won't.
You could change the static filter so it's only mapped to dojo requests, or to a directory where you plan on storing your static files. However, Struts will still present a problem since it's mapped to /* and it catches anything that ends in *.html. I don't know of a clean solution to do this - changing the default mapping is probably the easiest. With servlets as the front controllers, this is easy enough, but I'm not sure about filters. It's possible that the StaticFilter could be changed to handle dispatch to the Struts filter like it does with Spring and Tapestry's Servlet. If it makes you feel any better, the StaticFilter doesn't work at all with JSF. Matt On 3/28/07, wnqq <[EMAIL PROTECTED]> wrote:
Dear Matt, Thanks for the important info. Yes. I am using 2.0M4 which fails "integration-test" at the step "StaticPages" if <dispatcher>FORWARD</dispatcher> is added for the struts filter in web.xml. So, it looks like that I need to find another solution to achieve the goal of having a URL "xxxxxx.pdf". Any suggestions? TIA. mraible wrote: > > Are you using 2.0 M4? If so, does "mvn integration-test" pass? > There's a "StaticPages" test in src/test/resources/web-tests.xml that > verifies it works as expected. > > Matt > > On 3/28/07, wnqq <[EMAIL PROTECTED]> wrote: >> >> So, any other suggested solution to avoid this potential StatifFilter >> conflict? >> My goal is to allow a user be able to get a pdf report via a url of >> "xxxxxx.pdf" instead of "xxxxxx.html". >> >> >> mraible wrote: >> > >> > Just to warn you - if you're depending on the functionality of the >> > StaticFilter in 2.0 M4 - I haven't tested if it will work when Struts >> > intercepts the forward. >> > >> > Matt >> > >> > On 3/28/07, wnqq <[EMAIL PROTECTED]> wrote: >> >> >> >> Dear Matt, >> >> >> >> Many thanks. The following config works: >> >> >> >> web.xml: >> >> >> >> <filter-mapping> >> >> <filter-name>struts</filter-name> >> >> <url-pattern>/*</url-pattern> >> >> <dispatcher>REQUEST</dispatcher> >> >> <dispatcher>FORWARD</dispatcher> >> >> </filter-mapping> >> >> >> >> urlrewrite.xml: >> >> >> >> <rule> >> >> <from>^/report(.*)List.xls</from> >> >> <to type="forward">/report$1ListXLS.html</to> >> >> </rule> >> >> >> >> >> >> mraible wrote: >> >> > >> >> > Make sure you have <dispatcher>FORWARD</dispatcher> on your struts >> >> > filter to catch the forward. >> >> > >> >> > Matt >> >> > >> > > -- View this message in context: http://www.nabble.com/How-to-customize-Struts2-action-extention-%22.html%22-to-%22.pdf%22-or-%22.xls%22-for-reports--tf3477247s2369.html#a9725910 Sent from the AppFuse - User mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
-- http://raibledesigns.com --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
