Thank you for the help, but parsing the parameters is not the problem.
(Jason Hunter's MultipartRequest provided a good overview and implementation
for doing that)
The problem arises from my use of the Model II framework.
I need to get two parameter's from servlet I (The Controller servlet)
inorder to route the page to the appropriate
view(JSP).
But, when using MultipartRequest to parse the parameters and retrieve the
file the ServletInputStream is used
and unavailable for the chained JSP.
Everything works fine until I do the:
request.getRequestDispatcher("/view.jsp").forward(aRequest, aResponse);
At this point the ServletInputStream is unavaiblable for the receiving JSP
and the JSP generates a null exception.
Thanks,
Shone Sadler
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, June 20, 2000 3:54 PM
To: [EMAIL PROTECTED]
Subject: Re: Model II & MultipartRequest
Sneha Sharma@CONTEXT
06/20/2000 01:53 PM
Why don't u parse the stream for the parameters as well. I have code that
parses the input stream both for
attached file and the other parameters.
I am attaching the class.
Sneha(See attached file: FormRequest.java)
P.S. U might have to modify it as per your needs.
Shone Sadler <[EMAIL PROTECTED]> on 06/20/2000 04:12:19 PM
Please respond to [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
cc: (bcc: Sneha Sharma/Context)
Subject: Re: Model II & MultipartRequest
Hello everyone,
I am running into a slight problem. I am currently implementing the Model
II Framework for a java-based
application we have. We now need to add a JSP page that is used to upload
a
file from the client to the
server using the <input type=file> and <form enctype="multipart/form-data">
tags. Unfortunatly, the controller
servlet is unable to route a request to the proper page because it needs
two
parameters:
<input type=hidden name=page value="">
<input type=hidden name=handler value="">
When using the multipart request for uploading files the parameters are
unavailable through request.getParameter("page").
Instead, I am forced to get the servlets input stream and parse it. But
after parsing the InputStream I am unable to forward the request because
the
InputStream cannot be reset. The accepting JSP generates a null exception
because the InputStream
has already been read.
Has anyone had this problem? and/or does anyone have any suggestions for
getting around it?
Thanks in advance for any help!
Shone Sadler
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets