[ 
https://issues.apache.org/jira/browse/WW-3282?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13252820#comment-13252820
 ] 

Leonard Broman commented on WW-3282:
------------------------------------

I've been trying to figure this out with unit tests but to no avail...

The easiest way to see this is with the portlet app in the source code tree. 
Building, deploying and adding a portlet in the liferay container will give you 
links to few different functions. Like the simple form example. The url to the 
form action has the action encoded as a parameter like this:

struts.portlet.action=%2Fview%2FformExample

Which is correct. But, on the next view, there is a form. In the action url in 
the form you will find the same parameter:

struts.portlet.action=%2Fview%2Fview%2FprocessFormExample

Which has the duplication of the /view namespace. The form is not really broken 
by this, but when using the convention plugin, it does.

I'll try to figure out what is going wrong with this.



                
> Portlet namespace added multiple times when building form urls
> --------------------------------------------------------------
>
>                 Key: WW-3282
>                 URL: https://issues.apache.org/jira/browse/WW-3282
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Plugin - Portlet
>    Affects Versions: 2.1.8, 2.3.1.2
>         Environment: Found in portlet containers Jetspeed 2 and Sitevision
>            Reporter: Leonard Broman
>            Assignee: Johannes Geppert
>             Fix For: 2.5
>
>
> When building a form in a portlet, the action path in the portlet URL 
> contains the namespace multiple times, and thus the namespace is not correct.
> This happens in prependNamespace() in PortletUrlHelper where three components 
> are combined to form the complete namespace path.
> 1. Portlet namespace
> 2. Mode namespace
> 3. Tag namespace field (default current action namespace)
> In a simple form where namespace is not declared, and action i executing in 
> is proper mode namespace (ex. /portlet/view). Then 2 is "/portlet/view" and 3 
> is by default "/portlet/view" and thus complete namespace becomes 
> "/portlet/view/portlet/view"
> Workaround for portlet developers is to set the namespace parameter on the 
> form to "/" which results in only the mode namespace added to the path and 
> thus the correct action is executed.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to