Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » Struts 2 »

Re: Is it possible to get Struts' FilterDispatcher to serve up static files

Musachy Barroso

2007-02-27

Replies:

Is there a FAQ for S2 somewhere?

musachy

On 2/27/07, Musachy Barroso <musachy@(protected):
>
> Quoting the doc: "
>
> Common static content that is needed by the framework (JavaScript and CSS
> files, etc.) is served automatically by the FilterDispatcher filter. Any
> request starting with "/struts/" denotes that static content is required,
> and then mapping the value after "/struts/" to common packages in Struts 2
> and, optionally in the application's class path.
>
> By default, the following packages are searched:
>
>   - org.apache.struts2.static
>   - template
>
> Additional packages can be specified by providing a comma separated list
> to the configuration parameter named "packages" (configured in web.xml for
> the FilterDispatcher filter). When specifying additional static content, you
> should be careful not to expose sensitive configuration information (i.e.
> database password)."
> //I haven't used it myself :)
> musachy
>
> On 2/27/07, mraible < matt@(protected):
> >
> >
> > I'm using *.html as my default extension, which causes a whole host of
> > issues
> > with Dojo. Regardless, I want to fight through it and see if I can come
> > up
> > with a solution.
> >
> > I noticed that FilterDispatcher allows you to serve up static files from
> > the
> > classpath. Is it possible to configure this same filter so it can serve
> > up
> > static .html files from a "static" directory in my webapp root?
> >
> > Thanks,
> >
> > Matt
> > --
> > View this message in context:
> > http://www.nabble.com/Is-it-possible-to-get-Struts%27-FilterDispatcher-to-serve-up-static-files-tf3304172.html#a9191128
> > Sent from the Struts - User mailing list archive at Nabble.com .
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@(protected)
> > For additional commands, e-mail: user-help@(protected)
> >
> >
>
>
> --
> "Hey you! Would you help me to carry the stone?" Pink Floyd




--
"Hey you! Would you help me to carry the stone?" Pink Floyd
©2008 junlu.com - Jax Systems, LLC, U.S.A.