You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "Iwasa Kazmi (JIRA)" <ji...@apache.org> on 2010/01/06 11:29:44 UTC

[jira] Updated: (WW-3355) s:form tag render action URL with query string incorrectly

     [ https://issues.apache.org/struts/browse/WW-3355?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Iwasa Kazmi updated WW-3355:
----------------------------

    Attachment: DefaultActionMapper.java.diff

Here is my patch to resolve this problem.
Currently, the return value of the orig.getExtension() overrides the return value of the getDefaultExtension().
So if the requested URI had no extension, the new extension will be null. (and query-string will not be added)

I modified so that the default extension ("action") will be added if the requested URI  had no extension.
But it may causes compatibility issue.


> s:form tag render action URL with query string incorrectly
> ----------------------------------------------------------
>
>                 Key: WW-3355
>                 URL: https://issues.apache.org/struts/browse/WW-3355
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Plugin - Tags
>    Affects Versions: 2.1.8
>            Reporter: Iwasa Kazmi
>         Attachments: DefaultActionMapper.java.diff
>
>
> Normally,
> <s:form action="%{'Simple?a=123&b=234'}">
> would be rendered as:
> <form action="/mysite/Simple.action?a=123&amp;b=234" ... >
> But if the ".action" suffix is omitted in the request URL,
> (e.g. http://localhost/mysite/Simple )
> it will be rendered as:
> <form action="/mysite/Simple" ... >
> The query string is not appended.
> In org.apache.struts2.dispatcher.mapper.DefaultActionMapper#getUriFromActionMapping(),
> query string is appended only in case that the extension is provided.

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