tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Todd Kaplinger" <todd_kaplin...@hotmail.com>
Subject Re: requestDispatcher.include() custom tag
Date Tue, 04 Jun 2002 12:46:58 GMT

Wouldn't it be easier to just do pageContext.include("someResource.x");



>From: Aurlien Pelletier <apelletier@improve.fr>
>Reply-To: "Tomcat Users List" <tomcat-user@jakarta.apache.org>
>To: tomcat-user@jakarta.apache.org
>Subject: requestDispatcher.include() custom tag
>Date: Tue,  4 Jun 2002 11:15:10 +0200
>
>
>Hello,
>
>I have the following custom tag
>
>public class IncludeTag extends TagSupport {
>
>	public int doStartTag() throws JspException {
>
>		try {
>			pageContext.getRequest().getRequestDispatcher
>("test.html").include(pageContext.getRequest(), pageContext.getResponse());
>		} catch (ServletException e) {
>			System.err.println(e.getMessage());
>			e.printStackTrace();
>		} catch (IOException e) {
>			System.err.println(e.getMessage());
>			e.printStackTrace();
>		}
>
>		return SKIP_BODY;
>	}
>
>
>}
>
>And when I try to run it under tomcat 4.03 I get the following exception
>
>java.lang.IllegalStateException: getOutputStream() has already been called 
>for
>this response
>	at org.apache.catalina.connector.ResponseBase.getWriter
>(ResponseBase.java:755)
>	at org.apache.catalina.connector.ResponseFacade.getWriter
>(ResponseFacade.java:165)
>	at org.apache.jasper.runtime.JspWriterImpl.initOut
>(JspWriterImpl.java:166)
>	at org.apache.jasper.runtime.JspWriterImpl.flushBuffer
>(JspWriterImpl.java:158)
>	at org.apache.jasper.runtime.JspWriterImpl.flush(JspWriterImpl.java:205)
>	at org.apache.jasper.runtime.PageContextImpl.release
>(PageContextImpl.java:177)
>	at org.apache.jasper.runtime.JspFactoryImpl.internalReleasePageContext
>(JspFactoryImpl.java:198)
>	at org.apache.jasper.runtime.JspFactoryImpl.releasePageContext
>(JspFactoryImpl.java:193)
>	at org.apache.jsp.test$jsp._jspService(test$jsp.java:88)
>	at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
>	at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
>
>
>The exact same tag works wonderfully with resin.
>What's wrong??
>
>
>Thank you
>
>Aurlien
>
>--
>To unsubscribe, e-mail:   
><mailto:tomcat-user-unsubscribe@jakarta.apache.org>
>For additional commands, e-mail: 
><mailto:tomcat-user-help@jakarta.apache.org>
>


_________________________________________________________________
Chat with friends online, try MSN Messenger: http://messenger.msn.com


--
To unsubscribe, e-mail:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-user-help@jakarta.apache.org>


Mime
View raw message