This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Reading the file

 
Jithesh Kumar
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

How can we read the outputstream which we get as a response from webserver ?.
Actually i want to read the outputstream as i am getting a file as response?

Thanks in advance,

Jithesh
 
James Sabre
Ranch Hand
Posts: 781
Java Netbeans IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jithesh Kumar wrote:Hi all,

How can we read the outputstream which we get as a response from webserver ?.
Actually i want to read the outputstream as i am getting a file as response?

Thanks in advance,

Jithesh


Don't you mean InputStream ? The server wrote to an OutputStream (or equivalent) and you read the content from an InputStream. How you get access to this InputStream depends on what you are using to connect to the Web Server.
 
Jithesh Kumar
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


what you are using to connect to the Web Server



I think we are connecting to the webserver using request and response. So the issue is to get the stream of response where the webserver is writing.
 
James Sabre
Ranch Hand
Posts: 781
Java Netbeans IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jithesh Kumar wrote:


what you are using to connect to the Web Server



I think we are connecting to the webserver using request and response. So the issue is to get the stream of response where the webserver is writing.


The detail matters. What exactly are you using to connect to the web server. If you are using a URLConnection then you can get the response from an InputStream. Check the Javadoc for URLConnection, HttpURLConnection and HttpsURLConnection.
 
Jithesh Kumar
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thank you for responding.

for communicating a servlet with another servlet (in same webserver)if i use HttpURLConnection, can we send the request object from one servlet to another servlet or i have to send each parameter one by one to another servlet ?
 
James Sabre
Ranch Hand
Posts: 781
Java Netbeans IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jithesh Kumar wrote:thank you for responding.

for communicating a servlet with another servlet (in same webserver)if i use HttpURLConnection, can we send the request object from one servlet to another servlet or i have to send each parameter one by one to another servlet ?


You need to spend some time looking at the basics of Servlets.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic