I was thinking at something more simple then this.
When you pass an object  between servlet1 and servlet2, you pass also the
request object ( HttpServletRequest..)
So, in servlet2 you can do HttpSession session =
request.getSession(false);....right?.. ( where request is the request object
passed by servlet1)..
After  you serve you're client you can simple do a : session.invalidate();
and you're session that was passed from Servlet1 is no more a valid one.

Alin


----- Original Message -----
From: "Warren Crossing" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, May 22, 2001 5:26 PM
Subject: RE: ===>Session Question<===


> hi anil,
>
> i hope i've got your intention, you want to pass an object graph from
> servlet1 to servlet2.  tomcat provides session management through
> request.getSession().setAttribute() these objects are accessible for the
> duration of the session.  If you only want the object graph to live for
the
> lifespan of a single request then use request.setAttribute() and it will
> automatically destroy() when the response is returned to the
> tomcat-request-interceptor-responder-web-server-thingy ( i think that's
its'
> technical name ) ;
>
> warren.
>
> -----Original Message-----
> From: anil [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, 23 May 2001 5:26 AM
> To: tomcat
> Subject: ===>Session Question<===
>
>
> Hello,
>
> I do have servlet that process request and forward to another servlet.
> like.
> ->request-----> Servlet1------->servlet2
>                           session-obj-1    session-obj1(destroy
> session-obj1 request is done-user gets html back)
>
> At the end of sevlet2, user get html window back.
> I want setup a session object in servlet valid only for that request. I
> mean it should not valid beyond servlet2.
> if I use request.getSession(x), this session-obj1 is valid until the
> browser is closed.
>
> is there anyway to do this without calling removeAttribute() ????
>
> thanks
>
> anil
>

Reply via email to