tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Eric H." <ehara...@usc.edu>
Subject Re: Is it possible to use RequestDispatcher to include a jsp?
Date Thu, 15 Jun 2000 21:52:14 GMT
login.jsp is almost straight html. The response and request aren't
changed anywhere. I notice that if I make all the
includes *.jsp files, then it works. However, it doesn't properly set the
response header (neither a JSESSIONID cookie nor even Content-type). If I
use a single RequestDispatch.forward then it works properly (sets the
header correctly).

On Thu, 15 Jun 2000, Moises Solis wrote:

> Are you setting any headers or cookies in login.asp?   Have req and res
> being closed, overwritten, or changed in any way?    According to the docs
> on javax.servlet.RequestDispatcher.include(), it should work.
> 
> Moises.
> 
> 
> -----Original Message-----
> From: Eric H. <eharashe@usc.edu>
> To: tomcat-user@jakarta.apache.org <tomcat-user@jakarta.apache.org>
> Date: Thursday, June 15, 2000 2:38 PM
> Subject: Is it possible to use RequestDispatcher to include a jsp?
> 
> 
> >I'm using Tomcat with Apache, and inside of a servlet I try:
> >RequestDispatcher dispatch=req.getDispatcher("../login.jsp");
> >dispatch.include(req,res);
> >
> >and include a couple of html files the same way. (req=HttpServletRequest
> >and res=HttpServletResponse)
> >
> >Just including the plain html files is ok, but when I include a jsp, I get
> >the following error that leads me to believe Tomcat is flushing the output
> >and attempting to get a new Writer (causing an Exception since
> >RequestDispatcher.include files shouldn't do that). I tried increasing the
> >buffer size, but that didn't seem to work...
> >
> >Included servlet error: 500
> >
> >Location: /isd/nwdb/servlet/isd.nwdb.nwdbDispatcher
> >
> >Internal Servlet Error:
> >
> >java.lang.IllegalStateException: OutputStream is already being used for
> > this request at
> >java.lang.Throwable.fillInStackTrace(Native Method) at
> >java.lang.Throwable.fillInStackTrace(Compiled Code) at
> >java.lang.Throwable.(Compiled Code) at
> >java.lang.Exception.(Compiled Code) at
> >java.lang.RuntimeException.(RuntimeException.java:47) at
> >java.lang.IllegalStateException.(IllegalStateException.java:45) at
> >org.apache.tomcat.core.ResponseImpl.getWriter(ResponseImpl.java:210) at
> >org.apache.tomcat.core.HttpServletResponseFacade.getWriter(HttpServletRespo
> nseFacade.java:148) at
> >org.apache.jasper.runtime.JspWriterImpl.initOut(JspWriterImpl.java:154) at
> >org.apache.jasper.runtime.JspWriterImpl.flushBuffer(JspWriterImpl.java:146)
> at
> >org.apache.jasper.runtime.JspWriterImpl.flush(JspWriterImpl.java:191) at
> >_0002flogin_0002ejsplogin_jsp_0._jspService(_0002flogin_0002ejsplogin_jsp_0
> .java:73) at
> >org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:126) at
> >javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at
> >org.apache.jasper.runtime.JspServlet$JspServletWrapper.service(JspServlet.j
> ava:174) at
> >org.apache.jasper.runtime.JspServlet.serviceJspFile(JspServlet.java:261) at
> >org.apache.jasper.runtime.JspServlet.service(Compiled Code) at
> >javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at
> >org.apache.tomcat.core.ServletWrapper.handleRequest(Compiled Code) at
> >org.apache.tomcat.core.RequestDispatcherImpl.include(RequestDispatcherImpl.
> java:262) at
> >isd.nwdb.nwdbDispatcher.doDispatch(Compiled Code) at
> >isd.nwdb.nwdbDispatcher.doGet(nwdbDispatcher.java:18) at
> >javax.servlet.http.HttpServlet.service(HttpServlet.java:740) at
> >javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at
> >org.apache.tomcat.core.ServletWrapper.handleRequest(Compiled Code) at
> >org.apache.tomcat.core.ServletWrapper.handleRequest(ServletWrapper.java:597
> ) at
> >org.apache.tomcat.servlets.InvokerServlet.service(InvokerServlet.java:257)
> at
> >javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at
> >org.apache.tomcat.core.ServletWrapper.handleRequest(Compiled Code) at
> >org.apache.tomcat.core.ContextManager.service(ContextManager.java:559) at
> >org.apache.tomcat.service.connector.Ajp12ConnectionHandler.processConnectio
> n(Ajp12ConnectionHandler.java:156) at
> >org.apache.tomcat.service.TcpWorkerThread.run(Compiled Code) at
> >org.apache.tomcat.util.ThreadPool$ControlRunnable.run(Compiled Code) at
> >java.lang.Thread.run(Thread.java:485)
> >
> >-Eric Harashevsky
> >
> >
> >
> >--------------------------------------------------------------------------
> >To unsubscribe, email: tomcat-user-unsubscribe@jakarta.apache.org
> >For additional commmands, email: tomcat-user-help@jakarta.apache.org
> >
> 
> 
> --------------------------------------------------------------------------
> To unsubscribe, email: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commmands, email: tomcat-user-help@jakarta.apache.org
> 
> 
> 

-Eric Harashevsky, USC ISD Student Consultant



Mime
View raw message