Re: Session values getting lost
Well I figured it out. When I accessed the index.jsp, I accesses it with a different context root (In tomcat, it was the project name). Tomvat is somehow allowing me to do that. Since the history page had no context root, it woked, but after that when I use the correctcontext root, a new session gets created. Three hours wasted for nothing. Thanks for all you inputs On 3/12/07, Dave Newton <[EMAIL PROTECTED]> wrote: --- Dilip Ladhani <[EMAIL PROTECTED]> wrote: > Index Page > Home Page > > header,jsp > Schedule > Page > > Is the context root (present in header, missing in > index) making a difference?? Do both ways of making links work?! If you're creating absolute URLs then aren't the above two links pointing at separate webapps? (As an aside, why aren't you building the struts links with the struts tags?) d. No need to miss a message. Get email on-the-go with Yahoo! Mail for Mobile. Get started. http://mobile.yahoo.com/mail - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Session values getting lost
--- Dilip Ladhani <[EMAIL PROTECTED]> wrote: > Index Page > Home Page > > header,jsp > Schedule > Page > > Is the context root (present in header, missing in > index) making a difference?? Do both ways of making links work?! If you're creating absolute URLs then aren't the above two links pointing at separate webapps? (As an aside, why aren't you building the struts links with the struts tags?) d. No need to miss a message. Get email on-the-go with Yahoo! Mail for Mobile. Get started. http://mobile.yahoo.com/mail - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Session values getting lost
Sure. Actually, the code to access the session is in the action classes and not the jsps. It's the same code in both actions (for jsp1 and jsp2) String cdsID = ((UserTO)request.getSession().getAttribute("userInfo")).getCdsID(); I tried another thing, instead of going to jsp1 from index page (which was working), I am going to jsp2 (just changed the link and it worked So the bottom line is the links through the index page work, but the links throught the header.jsp (the header inserted using tiles) does not work. Here's how I create the links Index Page Home Page header,jsp Schedule Page Is the context root (present in header, missing in index) making a difference?? thanks On 3/12/07, Christopher Schultz <[EMAIL PROTECTED]> wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Dilip, Dilip Ladhani wrote: > I have this wierd problem, I have spent a few hours debugging. [index.jsp:] > session.invalidate(); > session = request.getSession(true); >session.setAttribute("userInfo", user); > > Now I go to the jsp1, and retrieve the userInfo from session, all works > well. > Now, when I go to jsp2, (off a link in my header), and try to retrieve > userInfo, I get a null Why's that? Can you post the relevant code from both jsp1 and jsp2? - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.7 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFF9Vyk9CaO5/Lv0PARAhAzAJ9DZ3gAtv85+OCyN57CkyMklOPg3ACgmD8j bP7f+J/8rzMXvFe5QH+6NHU= =t2l9 -END PGP SIGNATURE- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Session values getting lost
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Dilip, Dilip Ladhani wrote: > I have this wierd problem, I have spent a few hours debugging. [index.jsp:] > session.invalidate(); > session = request.getSession(true); >session.setAttribute("userInfo", user); > > Now I go to the jsp1, and retrieve the userInfo from session, all works > well. > Now, when I go to jsp2, (off a link in my header), and try to retrieve > userInfo, I get a null Why's that? Can you post the relevant code from both jsp1 and jsp2? - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.7 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFF9Vyk9CaO5/Lv0PARAhAzAJ9DZ3gAtv85+OCyN57CkyMklOPg3ACgmD8j bP7f+J/8rzMXvFe5QH+6NHU= =t2l9 -END PGP SIGNATURE- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Session values getting lost
Hello, I have this wierd problem, I have spent a few hours debugging. I am on tomcat 5.5 struts 1.29. I was using tomcat 5.0.x and struts 1.3.5 earlier and all seemed well. I switch and encounter this strange problem. My home jsp is a simple page, where I invalidate the session, create new and then add an object to my session session.invalidate(); session = request.getSession(true); session.setAttribute("userInfo", user); Now I go to the jsp1, and retrieve the userInfo from session, all works well. Now, when I go to jsp2, (off a link in my header), and try to retrieve userInfo, I get a null Why's that? What am I doing wrong?? thanks - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]