Java Mailing List Archive

http://www.junlu.com/

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

restful2 and struts.action.extension=

Pat O'Reilly

2007-02-09



I am hoping someone who is working with the restful2 action mapper could tell
me if there is a way to exclude certain extensions from being mapped to
actions. Specifically, I have configured my action like so:

<action name="catalog/*" class="productAction">
<param name="productName">{0}</param>
<result>view.jsp</result>
</action>

and in struts.properties I have: struts.action.extension=

With it left blank, then it maps any extension (or no extension) to actions,
but I would like to be able to access .jsp and .html resources without
having to do a special mapping in struts.xml. Given that I would probably
want to do the same thing in other contexts, then it seems like the easiest
way to do this would be with a list of extensions that are excluded from
being mapped to actions in struts.properties. Is there any way to do this
currently, such as a with a struts.action.extension.exclude property? Or
what is the best practice way of configuring this?

So, for instance with restful2 I can map /catalog/PlasmaTV to pull up a
product with name of PlasmaTV, but I would also like to have other html and
jsps directly accessible such as through /catalog/help.html or
/catalog/help.jsp without having to map an action specifically to that url.


--
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)

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