tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "John Clark L. Naldoza" <njcl...@ntsp.nec.co.jp>
Subject Re: How can i share session between servlet and jsp
Date Tue, 12 Dec 2000 11:58:01 GMT
Raphaƫl Lemaitre wrote:
> 
> Hi,
> 
>         I've got a big urgent problem : it seems that mu JSPs and my
> servlets don't share the same session. I explain :
> I have a JSP login form which action points to a servlet. In this servlet, i
> create the HttpSession object using request.getSession(true), i put an
> userID (String) in the session and forward to a JSP. In this JSP and all the
> JSPs i access directly (without passing through a servlet), the userID is
> still in the session. But when i want to follow a hyperlink that points to a
> servlet, i do not get the same session (session Ids are different). How can
> i do to make this work?
> 
>         thanks in advance

Perhaps you'd like to look at setParameters method of your http response
object...;-)

And then it would be a matter of forwarding the request,response to and
from your jsp and servlet.

Hope that helps.


John Clark
-- 
     /) John Clark Naldoza y Lopez                           (\
    / )    Software Design Engineer II                       ( \
  _( (_    _  Web-Application Development                    _) )_
 (((\ \>  /_>    Cable Modem Network Management System <_\  </ /)))
 (\\\\ \_/ /         NEC Telecom Software Phils., Inc.  \ \_/ ////)
  \       /                                              \       /
   \    _/  phone: (+63 32) 233-9142 loc. 3112            \_    /
   /   /  cellphone: (+63 919) 813-6274                     \   \
  /   / email: njclark@ntsp.nec.co.jp                        \   \

Mime
View raw message