[undertow-dev] Servlet request and form parameters

Michal Petrov mpetrov at redhat.com
Tue Mar 11 05:22:59 EDT 2014


I'm using getParts() but that prevents access to parameters via getParameter() and the like. Whereas calling getParts() after getParameter() works fine (loadParts() doesn't check if readStarted is true). There was no issue on WildFly 8 CR1 (Undertow 1.0.0.Beta30) but having compared the files, the loadParts() method wasn't changed, so there must've been something else that "pre-parsed" the form data.

Michal

----- Original Message -----
From: "Stuart Douglas" <sdouglas at redhat.com>
To: "Michal Petrov" <mpetrov at redhat.com>
Cc: undertow-dev at lists.jboss.org
Sent: Tuesday, March 11, 2014 1:55:01 AM
Subject: Re: [undertow-dev] Servlet request and form parameters

Its how the servlet spec says it should work. Basically if you read the 
request using the ServletInputStream or the Reader, then the servlet 
container can't parse data that has already been read. The servlet spec 
makes it quite clear that you can either read the data yourself, or have 
the container parse it for you, but not both.

Why are you handling multipart yourself anyway, and not just using 
HttpServletRequest.getParts()?

Stuart



Michal Petrov wrote:
> Hi,
>
> I'm from the RichFaces team and I've run into a problem with the HttpServletRequestImpl on WildFly 8 Final (Undertow 1.0.1.Final).
>
> In our fileUpload component we're intercepting the request and parsing the parts to find the uploaded files, wrapping it and passing it on. Reading the parts sets readStarted to true and so in the Restore View phase when JSF is checking the request parameters they are inaccessible because readStarted stops the parsing of form data. I can work around that but I'm wondering what's the reason for preventing the parsing.
>
> Thanks,
> Michal
> _______________________________________________
> undertow-dev mailing list
> undertow-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/undertow-dev


More information about the undertow-dev mailing list