File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Reading the file

 
Jithesh Kumar
Ranch Hand
Posts: 46
  • 0
  • 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
  • 0
  • 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
  • 0
  • 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
  • 0
  • 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
  • 0
  • 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
  • 0
  • 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.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic