commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andreas Schildbach <>
Subject Re: [FileUpload] Issue with multipart/form-data and request parameters in include
Date Sun, 28 Aug 2005 09:34:19 GMT
Hello Brian,

I am sorry my last answer was a bit sloppy. For the sake of simplicity, 
please consider the following JSP 2.0 fragment:

--- fragment.jsp ---
--- end fragment.jsp ---

This obviously outputs the parameter named p. Of course, my real 
fragment is much more complex than that, using an own controller and 
such (I was also using the words "plugin" and "portlet" because 
web-designers often use these. I was not talking about applets or 
embedded objects).

Ok, now here is a JSP which is the target of a form (I am skipping 
taglib defs):

--- target.jsp ---
<c:import url="fragment.jsp?p=value1"/>
hello world
<c:import url="fragment.jsp?p=value2"/>
--- end target.jsp ---

--- form.jsp ---
<form action="target.jsp" method="post" enctype="multipart/form-data">
   [skipping form fields]
--- end form.jsp ---

(and yes, I did get jsp:include and c:import mixed up in my last post)

Now, here is what happens with the different methods for posting the form:

1. GET: "value1 hello world value2"
2. POST (default enctype): "value1 hello world value2"
3. POST enctype="multipart/form-data": "hello world"

As I wrote, I am wondering why 2 works but I am very happy about it. It 
would be great if 3 worked as 2.

I wonder what would be a reliable way to add parameters to included 
resources, that works regardless of the type of initial request.

I am using FileUpload in a Spring ( context, in a 
way that can be compared to a Servlet filter:

<bean id="multipartResolver" 

I hope I left no questions open this time. Sorry for that last 
inaccurate post.



To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message