File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes Client 2 Servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Client 2 Servlet" Watch "Client 2 Servlet" New topic
Author

Client 2 Servlet

Leo Tse
Greenhorn

Joined: May 13, 2002
Posts: 6
Hi,
I'm trying to send a short string to my servlet, and I'm getting a getInputStream()already called for this request Exception. Anyone have any idea?
Thanks!!
I've included the client code below:
HttpURLConnection con = (HttpURLConnection)new URL("http://localhost:8080/ecog/sl/servlet/SLServlet?action=loansave3&loanid=1").openConnection();

con.setDoInput(true);
con.setDoOutput(true);
con.setUseCaches(false);
con.setDefaultUseCaches(false);
DataOutputStream out = new DataOutputStream(con.getOutputStream());

out.writeBytes("<Loan LoanID=1><LoanNo>aiyo</LoanNo></Loan>");
out.flush();
out.close();
return con.getInputStream();
Bosun Bello
Ranch Hand

Joined: Nov 06, 2000
Posts: 1510
This has been called already. con.getInputStream()
Just return the connection object.
[ May 13, 2002: Message edited by: Bosun Bello ]

Bosun (SCJP, SCWCD)
So much trouble in the world -- Bob Marley
 
 
subject: Client 2 Servlet