This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem with reading servlet output

 
Velika Srbija
Ranch Hand
Posts: 172
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I wanted to read response (raw data for the .jpg image) from the imageServlet into another servlet (mainServlet).
But, when I try to do it, like in the following piece of code:

...
URL url = new URL(protocol + context_path + "/imageServlet?param1=value1¶m2=value2¶m3=value3");
BufferedInputStream buf_is = new BufferedInputStream(url.openStream());
...

I get an error in the first line. It is a server error - code 500, saying "server is confused".
Note: The URL is correct. I have tested it with the jsp form and in that case it works OK.

Why this doesn't work?
What should I do?
 
Neeraj Dheer
Ranch Hand
Posts: 225
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can you post the entire exception please?
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic