According to the servlet's spec, the behavior of getParameter()
is undefined if you consumed the payload first through getInputStream 
or getReader:

"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 .getParameter method."

Jean-Marc

> -----Original Message-----
> From: Mauricio Nuñez [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, October 04, 2005 19:23
> To: Tomcat Users List
> Subject: Problems mixin getReader and getParameter
> 
> 
> Hi all,
> 
> I'm trying the following , with Tomcat 5.5.12 ( Also with 5.0.30 ) , 
> and after reading the request.getReader(), the
> request.getParameter("param") is unusable, returning null.
> 
> I'm trying setting a mark in the BufferedReader, but the 
> result it's the
> same.
> 
> Any hint?
> 
> public void doPost(HttpServletRequest request, 
> HttpServletResponse response)
>                       throws ServletException, IOException
> {
> 
>       String line=null;
>       BufferedReader br = request.getReader();
>       br.mark(4096);
>       while((line=br.readLine())!=null)
>       {
>               System.out.println("TBK:"+line);
>       }
>       br.reset();
>       request.getRequestDispatcher("close").forward(request,response);
> }
> 
> TIA
> 
> Mauricio Nuñez
> 
> 


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

Reply via email to