struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stuart Piltch <stu...@gradientblue.com>
Subject Re: Is it possible to get Struts' FilterDispatcher to serve up static files
Date Tue, 27 Feb 2007 20:56:24 GMT
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@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message