Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Duplicate
-
1.0.9m9
-
None
-
None
-
Debian linux, tomcat 5.5.7
Description
I have a jsp that uses the x:inputFileUpload and a h:commandButton to submit a file to my application. The required attribute is set on the x:inputFileUpload. When I click the h:commandButton without putting anything in the x:inputFileUpload, I get an error page. When I call Test.jsp, it jsp:includes TestMain.jsp which then includes TestBody.jsp. I was doing some debugging and followed it until I got the exception and noticed that it died where the code had a comment that the jsp:includes were being processed (I believe there was a call to doFilterChain). So I tried moving the TestBody.jsp out of the picture and putting the content in TestMain.jsp. When I did that it behaved properly. The content of the 3 files I am using follows:
Test.jsp
<jsp:include page="TestMain.jsp" flush="true">
<jsp:param name="bodyjsp" value="TestBody.jsp"/>
</jsp:include>
TestMain.jsp
<%@taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<html>
<body bgcolor="#ffffd8">
<f:view>
<f:subview id="body" >
<jsp:include page='<%=request.getParameter("bodyjsp") %>' flush="false" />
</f:subview>
</f:view>
</body>
</html>
TestBody.jsp
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://myfaces.apache.org/extensions" prefix="x" %>
<h:form id="id_mainForm" name="mainForm" enctype="multipart/form-data">
<h:panelGrid columns="1">
<x:inputFileUpload
id="id_fileUpload"
accept="text/.*"
storage="file"
required="true"/>
<h:message for="id_fileUpload" errorClass="error"/>
<h:commandButton id="id_importBtn" value="import"/>
</h:panelGrid>
</h:form>
Attachments
Issue Links
- duplicates
-
TOMAHAWK-1108 MultipartRequestWrapper doesn't handle request parameters correctly in JSF 1.2/JSP 2.1
- Closed