Krzysztof Zielinski wrote:

> Hello.
>
> I'm trying to get all parameters from request in right order.
>  Right order means that I need parameters in order as they were in HTML
>  Form.

Web browsers are not required to return the form values in the order they
are in in the form.
You should therefore not expect the results to be returned in any
particular order.
Bap.

>
>
> I can get all parameters by the help request.getParameterNames() but
>  it returns them as hash table keys. So we lost their original order.
>
> I have tried to use request.getInputStream() and get from the
>  ServletInputStream all parameters.
>
> Here is a BIG problem.
>
> I can't use request.getParameter() or request.getParameterNames() with
>  request.getInputStream().
> When I have used once request.getParameter() after this
>  request.getInputStream() returns empty streem.
>
> I have to be able to get stream after request.getParameter() because
> I'm using Cocoon. Cocoon calls request.getParameter() method before I
>  get request.getInputStream().
> This disadvantage is bigger because I can't use request.getParameter()
>  after using request.getInputStream().
>
> I have thought about some possible solutions:
> 1. Implement my own Request where getParameterNames()  return
>    parameters in right order.
>    This is done in Cocoon2 for specific form content type
>     "multipart/form-data"
>    Create my own form content type eg:"request/in-right-order" and for
>    this kinds of request use new Request implementation.
> 2. Write a patch to Request where could be possible to get
>    request.getInputStream() and request.getParameter() together.
> 3. Ask Tomcat developers about possible solution. :)
>
> --
> Best regards,
>  Krzysztof                          mailto:[EMAIL PROTECTED]
>   ICQ # 47933362

Reply via email to