Chris Shenton <[EMAIL PROTECTED]> writes:

> Daniel Rall <[EMAIL PROTECTED]> writes:
>
>> Turbine's use of ParameterParser may be doing this.
>
> I think you're right, PP and other routines. In the API docs for
> javax.servlet.ServletRequest.getParameter() I noticed:
>
>   If the parameter data was sent in the request body, such as occurs
>   with an HTTP POST request, then reading the body directly via
>   getInputStream() or getReader() can interfere with the execution of
>   this method.
>
> So if *anything* in Turbine calls getParameter() on a servlet's
> request, and the request had content in the body of a PUT or POST,
> then the body content will likely be trashed. This jives with what I'm
> seeing when I try to read a POST request body: stream already closed.
>
> There are related servlet methods which don't have such explicit
> warnings in the docs, but I expect must also trash the body content
> since they effectively do the same thing:
>
>   getParameterNames()
>   getParameterValues()
>   getParameterMap()
>
> The last one at least mentions "parameters are contained in the query
> string or posted form data" but neglects to mention any warning about
> trashed POST body content.
>
> I did a grep on the Turbine source and found 58 instances of
> "getParameter".  getParameters() is a method on the RunData, which
> appears central to Turbine, to do all kinds of stuff like check for
> valid sessions, redirects, and other stuff.
>
> Is it possible to turn off PP?  Or have PP (and any other
> parameter-reading calls) examine only the HTTP Request itself (URI +
> PATH_INFO + QUERY_STRING) and leave a HTTP POST body alone, like it
> would for a GET request?  Is it possible for me to read the body
> before Turbine tries to use getParameters() anywhere for anything?  Is
> there a request-processor for naked requests, much like there's a
> RawScreen for responses?
>
> (If I go with a Turbine-free servlet -- and avoid calls to
> getParameter*() -- I lose authentication and session tracking, among
> other Turbine benefits).

Not sure if this will help or not, but you could try this in your
TR.props:

  # Whether the files should be automatically picked up by
  # ParameterParser.

  services.UploadService.automatic=false

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to