You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by Shinobu Kawai <sh...@gmail.com> on 2004/10/01 01:43:36 UTC

Re: Handling POST in VelocityServlet (RESOLVED)

Hi.

> Hi, I don't think this is a Velocity bug. In your doPost methdd, you
> need to check
> FileUpload.isMultipartContent(request). If it's true,  you need to use
> DiskFileUpload.parseRequest to get the form parameters and file name
> etc. If not, you can use request.getParameters. This is documented in
> FileUpload usage.
Yes, it looks more like a servlet issue.  Check here for other solutions:
   http://www.magelang.com/faq/view.jsp?EID=1045507

Best regards,
-- Shinobu Kawai

-- 
Shinobu Kawai(shinobu.kawai@gmail.com)

---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


Re: Handling POST in VelocityServlet (RESOLVED)

Posted by Shinobu Kawai <sh...@gmail.com>.
Hi.

> > Hi, I don't think this is a Velocity bug. In your doPost methdd, you
> > need to check
> > FileUpload.isMultipartContent(request). If it's true,  you need to use
> > DiskFileUpload.parseRequest to get the form parameters and file name
> > etc. If not, you can use request.getParameters. This is documented in
> > FileUpload usage.
> Yes, it looks more like a servlet issue.  Check here for other solutions:
>    http://www.magelang.com/faq/view.jsp?EID=1045507
A bit more detail.

If you look in the Java Servlet Specification, under "SRV.4.1.1 When
Parameters Are Available", you will see:

<excerpt>
The following are the conditions that must be met before post form data
will be populated to the parameter set:
1. The request is an HTTP or HTTPS request.
2. The HTTP method is POST.
3. The content type is application/x-www-form-urlencoded.
4. The servlet has made an initial call of any of the getParameter
family of methods on the request object.
</excerpt>

Item #3 says, that if you set any other enctype, they will not be
available via the getParameter methods.

So this is not a bug at all, but a good sign that Jetty is following the
specs.

Best regards,
-- Shinobu Kawai

--
Shinobu Kawai <sh...@gmail.com>


---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org