Multipart/form-data forms doesn´t work on ROOT Context
------------------------------------------------------

                 Key: TOMAHAWK-680
                 URL: http://issues.apache.org/jira/browse/TOMAHAWK-680
             Project: MyFaces Tomahawk
          Issue Type: Bug
          Components: ExtensionsFilter
    Affects Versions: 1.1.5-SNAPSHOT
         Environment: Embebed Tomcat 5.5 / Windows XP Professional
            Reporter: Lucas Alves Machado


Problem:
When using a enctype="multipart/form-data" form after the first post the action 
of the form is rendered incorrectly example:

File "some.jsp"
<s:form enctype="multipart/form-data" >

<h:commandButton value="whatever" action="some_outcome"/> <%-- This outcome 
message returns to the same form --%>

</s:form>

In the first rendered the action is "/some.faces"
On the second call the action is "//some.faces"

This is happening because in the render phase the 
org.apache.myfaces.application.jsp.JspViewHandlerImpl does the folowing:

String path = getViewIdPath(facesContext, viewId);
if (path.length() > 0 && path.charAt(0) == '/')
{
   return facesContext.getExternalContext().getRequestContextPath() + path;
}

and the method "facesContext.getExternalContext().getRequestContextPath()" 
returns empty String "" when called on the ROOT context uppon the instance of  
"org.apache.catalina.connector.RequestFacade" and returns "/" when called uppon 
"org.apache.myfaces.webapp.filter.MultipartRequestWrapper".

So on the second call with is over a multipart request lots of components 
(including form) renders incorrect paths.
org.apache.myfaces.webapp.filter.MultipartRequestWrapper.getContextPath() 
should also return empty String "" when called from an app installed on ROOT 
context

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


Reply via email to