Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Client 2 Servlet

 
Leo Tse
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1510
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This has been called already. con.getInputStream()
Just return the connection object.
[ May 13, 2002: Message edited by: Bosun Bello ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic