Wrox Programmer Forums
|
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 9th, 2004, 05:02 PM
Registered User
 
Join Date: Jul 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Session is not getting Transferred in servlets.

Dear Sir/madam,

I am developing my school project where I have to maintain a login form(invokes Login servlet) which contains the lastname of the user. I am setting this using

 HttpSession session = request.getSession(true);
                                if(session.isNew() == false)
                                {
                                        session.invalidate();
                                  session = request.getSession(true);
                                }
 System.out.println("Session in first servlet second time
is:"+session.toString());

           session.setAttribute("lastname",sel2);

then after submitting this info user will have a "HTML LINK" to go into a DIFFERENT "html file" which invokes Servlet with name "LOGGED" after clicking on submit

I got the session attribute in LOGGED servlet as such here

 HttpSession session = request.getSession();
 String lastname = (String)session.getAttribute("lastname");

 System.out.println(lastname);

when I print this I m getting null into it. I m unable to understand whats wrong with this. I have done the same thing day before yesterday and it worked but it surprisingly giving me "NULL" when I m testing this today morning. Could anyone please throw light on this.I would be very grateful.

Thank You
Sai Krishna
 
Old July 9th, 2004, 11:57 PM
Friend of Wrox
 
Join Date: Oct 2003
Posts: 463
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to madhukp
Default

This seems to be a wrong post. Please post this issue to the forum Java / Beginning JSP.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Combo Box dependent transferred to another form Ebaad Access VBA 1 May 17th, 2007 12:50 PM
Servlets achukuttan Servlets 1 March 26th, 2007 02:04 AM
constructor in servlets bondalapati98 Servlets 5 January 16th, 2006 12:27 AM
Capturing date from transferred file Axxess Access VBA 2 July 18th, 2005 05:21 AM
Email using servlets sonurijs Pro JSP 3 March 11th, 2005 02:37 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.