Hi all,
I searched the forum to fix the problem which iam facing on ServletInputStream.
I want to read the servletinputstream.
But the method
servletinputstream.available() is returning me "0" bytes.
Contrarily
request.getContentLength() is returning me "268" bytes.
my requirement is to read the servletinputstream and forward that stream to an application residing in the different server through URL connection. But iam failing in read() itself.
Here is my code
Iam submitting the following form to an JSP (ReadForm.jsp)
<form action="ReadForm.jsp" method="post" enctype="multipart/form-data">
<input type=text name='uname'><br>
<input type=password name='pword'><br>
<input type=hidden name='pagename' value="WPS/ReadForm"><br>
<input type=file>
<input type=submit><br>
</form>
ReadForm.jsp contains following code
InputStream sis = request.getInputStream();
int noofBytes = sis.available();
out.println("no of bytes" + noofBytes);
out.println("<br>contentlength " +request.getContentLength())
The output is
no of bytes 0
contentlength 389
please tell me where iam going wrong?
Thanks,
Regards,
PLR.Kannan
I searched the forum to fix the problem which iam facing on ServletInputStream.
I want to read the servletinputstream.
But the method
servletinputstream.available() is returning me "0" bytes.
Contrarily
request.getContentLength() is returning me "268" bytes.
my requirement is to read the servletinputstream and forward that stream to an application residing in the different server through URL connection. But iam failing in read() itself.
Here is my code
Iam submitting the following form to an JSP (ReadForm.jsp)
<form action="ReadForm.jsp" method="post" enctype="multipart/form-data">
<input type=text name='uname'><br>
<input type=password name='pword'><br>
<input type=hidden name='pagename' value="WPS/ReadForm"><br>
<input type=file>
<input type=submit><br>
</form>
ReadForm.jsp contains following code
InputStream sis = request.getInputStream();
int noofBytes = sis.available();
out.println("no of bytes" + noofBytes);
out.println("<br>contentlength " +request.getContentLength())
The output is
no of bytes 0
contentlength 389
please tell me where iam going wrong?
Thanks,
Regards,
PLR.Kannan