You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Leonard Wolters <l....@chello.nl> on 2002/08/28 18:26:23 UTC

using tags/servlets within jsp's

Is it possible to include a tag (or servlet) in a jsp which directly
writes to the outputstream (the same on as the jsp) ?

Right now, tomcat is throwing a "org.apache.jasper.
runtime.ServletResponseWrapperInclude.getOutputStream..."
or a "java.lang.IllegalStateException: getOutputStream() 
has already been called for this response"

In other words, is it possible that a tag (or servlet) together
with a normal jsp build up a screen ?

T.i.a.

Leonard

Re: using tags/servlets within jsp's

Posted by "Craig R. McClanahan" <cr...@apache.org>.

On Wed, 28 Aug 2002, Leonard Wolters wrote:

> Date: Wed, 28 Aug 2002 18:26:23 +0200
> From: Leonard Wolters <l....@chello.nl>
> Reply-To: Struts Users Mailing List <st...@jakarta.apache.org>
> To: "Struts Users Mailing List (E-mail)" <st...@jakarta.apache.org>
> Subject: using tags/servlets within jsp's
>
> Is it possible to include a tag (or servlet) in a jsp which directly
> writes to the outputstream (the same on as the jsp) ?
>
> Right now, tomcat is throwing a "org.apache.jasper.
> runtime.ServletResponseWrapperInclude.getOutputStream..."
> or a "java.lang.IllegalStateException: getOutputStream()
> has already been called for this response"
>
> In other words, is it possible that a tag (or servlet) together
> with a normal jsp build up a screen ?
>

Sure ... in the calling JSP page, use <jsp:include>.  In the called page
or servlet, you have to use response.getWriter (to get a
character-oriented output stream), not response.getOutputStream() which is
for binary output.  You can't mix character and binary output on the same
response.

> T.i.a.
>
> Leonard


Craig



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>