tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Larry Isaacs <Larry.Isa...@sas.com>
Subject RE: To maintain bean session from a jsp called in a servlet?
Date Wed, 12 Sep 2001 17:56:19 GMT
The preferred method for tracking sessions between requests is to
store a session ID in a cookie.  If you can assume that all
browsers accessing your site will have cookies enabled, then
you don't need to do anything special to have sessions work.

If you can't make that assumption, you must use 
HttpServletResponse.encodeURL() to "fix" the URL's you include
as links in the content returned to the browser.  This method
adds ";jsessionid=<the session ID>" to the URL if needed.
When the modified link is clicked, the URL carries the
session ID should cookies be disabled.

Larry

> -----Original Message-----
> From: Lessault Jean-Luc [mailto:JL.Lessault@kheops.com]
> Sent: Wednesday, September 12, 2001 10:58 AM
> To: 'tomcat-user@jakarta.apache.org'
> Subject: RE: To maintain bean session from a jsp called in a servlet?
> 
> 
> 
> Thank you asheesh for your answer, nevertheless I don't use cookies 
> but just only HttpSession Objects.
> 
> Cheers, jean luc.
> 
> -----Message d'origine-----
> De?: asheesh [mailto:asheesh@q2aindia.com]
> Envoye?: dimanche 24 juin 2001 12:16
> A?: tomcat-user@jakarta.apache.org
> Objet?: Re: To maintain bean session from a jsp called in a servlet?
> 
> 
> Check ur browser settings see if cookies are enabled or not ?
> 
> Cheers
> asheesh
> 
> ----- Original Message ----- 
> From: Lessault Jean-Luc <JL.Lessault@kheops.com>
> To: <tomcat-user@jakarta.apache.org>
> Sent: Wednesday, September 12, 2001 5:48 PM
> Subject: To maintain bean session from a jsp called in a servlet?
> 
> 
> > 
> > Hi,
> > 
> > I'm working on a cache Web, and I would like to maintain 
> > beans session from jsp files called in a servlet. But I loose
> > them although I keep the servlet session.
> > Does someone know how to solve this problem?
> > 
> > Thanks.
> > 
> > 
> 
> 

Mime
View raw message