[ http://issues.apache.org/struts/browse/WW-1323?page=all ]

Don Brown updated WW-1323:
--------------------------

     Summary: Form tag allows ".action" in the "action" parameter  (was: 
FilterDispatcher accepts ".action" in the action name, but the AJAX validation 
code doesn't)
    Assignee: Don Brown

The problem here, as I see it, is that the form's action attribute allows you 
to use the extension attached to the action name.  The core issue is that the 
default action mapper, when building a uri, doesn't bother to add the extension 
if it exists already.  This can mask problems, like this one, where people 
specify the exension in the action name where they shouldn't.

I've made this fix to the action mapper, however when in compatibiility mode, 
the old behavior is retained.

> Form tag allows ".action" in the "action" parameter
> ---------------------------------------------------
>
>                 Key: WW-1323
>                 URL: http://issues.apache.org/struts/browse/WW-1323
>             Project: Struts 2
>          Issue Type: Improvement
>          Components: Dispatch
>    Affects Versions: WW 2.2.2
>         Environment: Any platform (tested on Tomcat 5.5 running on Kubuntu 
> Linux - Dapper Drake Beta).
>            Reporter: Vitor Souza
>         Assigned To: Don Brown
>            Priority: Minor
>             Fix For: 2.0.0
>
>
> See forum discussion at: 
> http://forums.opensymphony.com/thread.jspa?messageID=61695
> When we use WW HTML form tag, the correct way to do it is write the action 
> name without the ".action" extension, which will be added automatically by 
> the JSP tag in the generated HTML tag:
> <#-- Using freemarker --#>
> <@ww.form action="myaction" method="post" validate="true" theme="ajax">
> However, if you do write the ".action" extension:
> <@ww.form action="myaction.action" method="post" validate="true" theme="ajax">
> The FilterDispatcher works anyway, dispatching the request to the correct 
> action.  However, the validation framework generates a JavaScript code WITH 
> the ".action" extension:
> var containingForm = document.getElementById("myaction.action");
> Which doesn't work, since it's server counterpart is listening only for calls 
> to "myaction", with no extension.
> This is not a bug, but I think technologies (programming languages, 
> frameworks, etc.) should strive to maintain orthogonality: if something works 
> in a certain manner in one part, the user expects it to work in the same 
> manner in all other parts. 
> This can confuse begginners, since when you write a HTML form (without JSP 
> tags), you have to put the .action extension. Some people are used to it and 
> they keep using it since the FilterDispatcher doesn't mind, but when the 
> validation doesn't work, the last thing they suspect on is the action 
> property of the ww:form tag.
> This is just a suggestion. I leave the decision to the development team. 
> Thanks!

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://issues.apache.org/struts/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to