Java Mailing List Archive

http://www.junlu.com/

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

Using the Restful2ActionMapper

Philip Lorenz

2007-02-05

Replies:

Hi,

I am trying to use the Restful2ActionMapper for my project. However I have not been able to configure it correctly so far.

My struts.xml looks like the following:

<struts>

 <constant name="struts.mapper.class" value="restful2" />

 <constant name="struts.enable.SlashesInActionNames" value="true" />

 <package name="default" extends="struts-default">
   <action name="view/*" class="com.test.View">
     <result>/test.jsp</result>
   </action>
 </package>
</struts>

However mapping does not work at all. After enabling SlashesInActionNames and accessing the URL "/view/uploadId/5.action" I get a "There is no Action mapped for action name uploadId/5" error. Disabling it only leads to to an error message that the action 5 could not be found.

After having a glimpse at the source code it the class does not seem to set the action name correctly (it receives the correct URL however). Is this a known problem or did I misconfigure my application?

Any hints would be appreciated.

Philip Lorenz

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

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