You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Jonathan Gordon <jg...@viant.com> on 2000/08/18 07:14:10 UTC

Session problem with RequestDispatcher Include

i've run into a problem with sessions using the include method of the
RequestDispatcher.  if i include a file, sessions don't seem to work.  if i
forward to a file, all seems fine.  

My setup:
tomcat 3.2 beta2
i'm running redhat linux, kernel 2.2.14-5.0smp
i'm using sun's jdk1.2.2_06

To reproduce:
Add the following three lines to the end of the doGet method in the
SessionExample servlet included in the "examples" application:

********************************************************************
out.println("Is session new? "+session.isNew());
RequestDispatcher rd = request.getRequestDispatcher("/sessionTest.jsp");
rd.include(request, response);
********************************************************************

where sessionTest.jsp lives under the "examples" root and contains the following
text:
<br>i'm included</br>

when you call the servlet, you'll notice that the session is always new, and
will not accumulate data.  you'll also see the "i'm included" text at the
bottom.

is this a tomcat bug, or am i missing something about how includes should work?

thanks,

Jonathan.