• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

Client 2 Servlet

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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();
 
Ranch Hand
Posts: 1514
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
I'm gonna teach you a lesson! Start by looking at this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic