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

Stuart Piltch

2007-02-27

Replies:

mraible <matt <at> raibledesigns.com> writes:
> 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.

Hi Matt,

I'm not sure about your specific FilterDispatcher question, but we also use
*.html as a default extension. We ended up copying all the dojo html files that
we use into out own /WEB-INF/widgets directory and adding an extra
struts-dojo.xml file to our config:

<!DOCTYPE struts PUBLIC
    "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
    "http://struts.apache.org/dtds/struts-2.0.dtd">

<struts>
  <package name="dojo" namespace="/struts/dojo/src/widget/templates"
extends="base">
    <action name="*">
       <result type="plainhtml">/WEB-INF/widgets/{1}.html</result>
    </action>
  </package>
  <package name="dojoEditor2"
namespace="/struts/dojo/src/widget/templates/Editor2" extends="base">
    <action name="*">
       <result type="plainhtml">/WEB-INF/widgets/Editor2/{1}.html</result>
    </action>
  </package>
  <package name="dojoEditor2Dialog"
namespace="/struts/dojo/src/widget/templates/Editor2/Dialog" extends="base">
    <action name="*">
       <result
type="plainhtml">/WEB-INF/widgets/Editor2/Dialog/{1}.html</result>
    </action>
  </package>
</struts>

It seems convoluted, but it's working. The other dojo files (css, js, etc) are
working fine from within the struts jar.

Cheers,

- stuart



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)

©2008 junlu.com - Jax Systems, LLC, U.S.A.