Yeah, I saw those notes too... I found them a tad confusing :)

I would have thought it was the OutputStream that was already gotten, contrary to what the note says... If it was the PrintWriter that was already gotten, then why was the solution to call getWriter() instead?

I get the feeling those notes are actually backwatds because as they are it doesn't make sense to me. Or something else entirely is going on. That's the problem for me... if I don't really understand what was wrong, and why the fix is what it was, I can't be sure this code will work in all cases going forward, and that worries me since it is part of a generic package.

Frank

Jay Burgess wrote:
Not a full explanation, but the Javadoc for ServletResponse.getOutputStream()
does say:

Throws:
java.lang.IllegalStateException - if the getWriter method has been called on
this response

Conversely, getWriter() says:

Throws:
java.lang.IllegalStateException - if the getOutputStream  method has already
been called for this response object

It'd seem that the Writer had already been acquired.

Jay

| Jay Burgess [Vertical Technology Group]
| "Essential Technology Links via RSS"
| http://www.vtgroup.com/



-----Original Message-----
From: Frank W. Zammetti [mailto:[EMAIL PROTECTED] Sent: Friday, June 17, 2005 1:21 PM
To: tomcat-user@jakarta.apache.org
Subject: Re: JSP including servlet output

Never mind, got it... changed:

ServletOutputStream out = response.getOutputStream();

..to...

PrintWriter out = response.getWriter();

...and it now works.  I wouldn't mind an explanation though :)


--
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to