Nick,
The way I do it is to have a web server front end backing off to a
servlet engine and serve the static content from the web server.
To give you an example of one of my sites (andappstore.com), I have
Apache at the front end which connects to Tomcat at the back end via
mod_jk & ajp13, this means that the dynamic parts of the site are under
a path (e.g. http://andappstore.com/AndroidPhoneApplications/apps/) and
the static content is served by Apache without involving Tomcat (e.g.
http://andappstore.com/images/defaulticon.jpg)
This may be overkill for your app, but I've found that using Apache as a
front end gives me more flexibility over bother dynamic and static
content than trying to serve everything from an appserver.
Al.
Nick J wrote:
Oh well, no one's answered me yet, but I have found a way, but it's not very
satisfactory.
The problem (as well as the action extension being set to empty string) was
I had an action in the default namespace as <action name="*"...> so it would
intercept all remaining requests.
For static content, I needed these additional packages-
not ideal, because the namespaces are not hierarchical I need a separate
namespace for each static content folder. Can anyone think of a better way?
<package name="static" extends="struts-default" namespace="/static">
<action name="*">
<result>/{1}</result>
</action>
</package>
<package name="static-css" extends="struts-default"
namespace="/static/css">
<action name="*">
<result>/css/{1}</result>
</action>
</package>
<package name="static-js" extends="struts-default"
namespace="/static/js">
<action name="*">
<result>/js/{1}</result>
</action>
</package>
Nick J wrote:
I am using struts2.
I don't want .action or .do on the end of the url's, so I set
struts.action.extension='' (empty string)
--
Al Sutton
W: www.alsutton.com
B: alsutton.wordpress.com
T: twitter.com/alsutton
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]