Return-Path: Delivered-To: apmail-jakarta-tomcat-user-archive@www.apache.org Received: (qmail 35753 invoked from network); 9 Oct 2003 14:54:39 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 9 Oct 2003 14:54:39 -0000 Received: (qmail 8703 invoked by uid 500); 9 Oct 2003 14:53:53 -0000 Delivered-To: apmail-jakarta-tomcat-user-archive@jakarta.apache.org Received: (qmail 8662 invoked by uid 500); 9 Oct 2003 14:53:53 -0000 Mailing-List: contact tomcat-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Tomcat Users List" Reply-To: "Tomcat Users List" Delivered-To: mailing list tomcat-user@jakarta.apache.org Received: (qmail 8586 invoked from network); 9 Oct 2003 14:53:52 -0000 Received: from unknown (HELO smtpzilla5.xs4all.nl) (194.109.127.141) by daedalus.apache.org with SMTP; 9 Oct 2003 14:53:52 -0000 Received: from webmail.xs4all.nl (webmail6.xs4all.nl [194.109.127.37]) by smtpzilla5.xs4all.nl (8.12.9/8.12.9) with SMTP id h99ErsJA028182 for ; Thu, 9 Oct 2003 16:53:54 +0200 (CEST) Received: from 193.172.8.132 (SquirrelMail authenticated user rudidoku) by webmail.xs4all.nl with HTTP; Thu, 9 Oct 2003 16:53:54 +0200 (CEST) Message-ID: <8757.193.172.8.132.1065711234.squirrel@webmail.xs4all.nl> In-Reply-To: References: Date: Thu, 9 Oct 2003 16:53:54 +0200 (CEST) Subject: RE: String added to session in servlet not available in jsp From: rudidoku@xs4all.nl To: "Tomcat Users List" User-Agent: SquirrelMail/1.4.2 [CVS] MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N > Can you please show how are you creating the session object??? No worries, here it is: HttpSession session = request.getSession(true); session.setAttribute("usr", request.getParameter("username")); > Sincerely > Lic. Computer Science > Erlis Vidal Santos > > -----Original Message----- > From: rudidoku@xs4all.nl [mailto:rudidoku@xs4all.nl] > Sent: Thursday, October 09, 2003 10:44 AM > To: tomcat-user@jakarta.apache.org > Subject: String added to session in servlet not available in jsp > > Hi, > > I created a session object and added a string (username) to it. > Systemout.println shows the username from the request. My page is then > forwarded to another as follows: > > RequestDispatcher disp = ctx.getRequestDispatcher(target); > disp.forward(request, response); > > On this jsp page, I have teh following code: > > String usr = (String)session.getAttribute("usr"); > out.println("User: " + usr + "!"); > out.println("Session Id: " + session.getId()); > > The page displays the session Id but not the usr. > > I'm quite baffled at why this is the case. > > looking in google for similar problems, but any help would be much > appreciated! > > Rudi > > --------------------------------------------------------------------- > To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org > For additional commands, e-mail: tomcat-user-help@jakarta.apache.org > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org > For additional commands, e-mail: tomcat-user-help@jakarta.apache.org > > > --------------------------------------------------------------------- To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: tomcat-user-help@jakarta.apache.org