[ 
https://issues.apache.org/struts/browse/WW-1706?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_42205
 ] 

Shane Frensley commented on WW-1706:
------------------------------------

Hi Vijay.C.K,

Could it be that you have specified a method in your action definition?

<action name="editBlogEntryForm/*" method="view" class="editBlogFormAction">

normall I see this action mapper without a method specified:

<action name="editBlogEntryForm/*" class="editBlogFormAction">

The Restul2ActionMapper will determine the method for you. In this case:

http://localhost/app/blog/title/BlogTitle/editBlogEntryForm.action

I believe it's going to call execute() since it doesnt end with a slash as 
documented by the examples in the javadoc.

a url like:

http://localhost/app/blog/title/BlogTitle/editBlogEntryForm/.action

will call index().

Seems quirky, but that's the way it's documented.  

See the javadoc as the methods are also different according to the HTTP method 
used as well.



> Restful2ActionMapper does not set parameters/ActionName correctly
> -----------------------------------------------------------------
>
>                 Key: WW-1706
>                 URL: https://issues.apache.org/struts/browse/WW-1706
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Dispatch
>    Affects Versions: 2.0.6
>            Reporter: Philip Lorenz
>            Assignee: Don Brown
>
> Restful2ActionMapper does not seem to treat REST URLs correctly.
> Replacing
> String params = actionName.substring(0, actionSlashPos);
> at line 146 (Restful2ActionMapper.java) with
> String params = actionName.substring(actionSlashPos + 1);
> and
> mapping.setName(actionName.substring(actionSlashPos+1));
> at line 177 with
> mapping.setName(actionName.substring(0, actionSlashPos));
> will perform the expected behaviour of setting the ActionName to view and 
> setting the parameter uploadId to 5 for the following URL (view/uploadId/5).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to