Now this is timely... :)
I just submitted a fix to the Tomcat sources that will cause an exception
to be thrown from HttpUtils.parsePostData() if the data available from the
input stream is less than the indicated length. Currently parsePostData()
the released Tomcat code returns null in this case.
This doesn't fix your problem, but would have made it more understandable.
My guess is that what you have done is read data from the input stream
before passing the request to the second page, so there simply isn't any
data to be read (certainly not request.getContentLength() worth) left in
the input stream.
Of course, this is only a guess... :)
From: Moonim Masaoud
> I have a JSP with a form with 2 buttons, on the click of a any of the buttons
> I submit the form using POST, in the action I call this page again. I check
> which was the button pressed, and accordingly I forward to respective pages.
> In the forwarded pages I want all the fields passed from the first form. So
> I use HttpUtils: parsePostData(int, ServletInputStream) to get a hashtable.
> For the ServletInputStream parameter I pass request.getInputStream() and for
> the int parameter I use request.getContentLength().
>
> But somehow the hashtable always is null !!!
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
FAQs on JSP can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html