> 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


Just a quick follow up on this.

By replacing 
String params = actionName.substring(0, actionSlashPos);
at line 146 in Restful2ActionMapper with
String params = actionName.substring(actionSlashPos + 1);

and
mapping.setName(actionName.substring(actionSlashPos+1));
at line 177 with
mapping.setName(actionName.substring(0, actionSlashPos));

I get the expected behaviour of setting the variable uploadId to 5 using the 
following URL: view/uploadId/5

Is this a bug or am I misunderstanding the documentation regarding REST-based 
URLs?

Philip

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to