I am having two problems with this. First my file will not display, second I get a System Out Error. Please help.
[11/6/08 14:38:01:891 CST] 00000033 ServletWrappe E SRVE0068E: Could not invoke the service() method on servlet ViewDrawing6. Exception thrown : java.lang.IllegalStateException: SRVE0199E: OutputStream already obtained
You don't. You can't return two responses to a single request.
You're going to need to back up and explain what it is that you are really trying to accomplish.
Joined: Nov 16, 2004
On my JSP I have a function that uses a jQuery.getJSON call to the servlet sending a url address as a parameter. It is supposed to display a drawing cooesponding to the url. If the url does not exist I want to return a flag to the calling JSP and display a message to that effect. If the url does exist I want to display the drawing. Right now the servlet code rus but no drawing is displayed.
Your code is not complete, but I suspect you're doing exactly what your exception message says. Trying to write multiple responses to one request. Are you using a RequestDispatcher to talk to a JSP after writing to the OutputStream?
What a JSP does is basically make an HTML page and write it to the response object. If you've already written to the response object and then you write a whole jsp page... then of course you get that exception. You can't write the response, and then dispatch to a JSP, because you've already written your response!