use the inputstream to write to a file and to process.
I have a servlet that uses the HttpServletRequest stream, req.getInputStream(),
to write to a file and to process data. The way I understand is that once
you use it the input stream buffer is clear. Is there a way to use one input
stream to do both tasks?
Here is the code.
public class AcceptorWeb extends FWServlet
public void doGet(HttpServletRequest req, HttpServletResponse res) throws
res.setContentType( "text/html" );
writeToFile( req.getInputStream() );
acceptFormData( req.getInputStream() );
public void writeToFile(InputStream is) throws Exception
public void acceptFormData(InputStream is) throws Exception
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL