wood burning stoves 2.0*
The moose likes JSP and the fly likes JSP session tracking problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "JSP session tracking problem" Watch "JSP session tracking problem" New topic
Author

JSP session tracking problem

Raghavender Ammagari
Greenhorn

Joined: Aug 11, 2008
Posts: 13
Hello everybody.....i am a newbie to jsp. I just started writing a login page using jsp, partial code of which is given below.....
My requirement is that if there is no session exists.....it should show the login field table.....otherwise it should show welcom + usename by getting it from session.getAttribute....the action of the form is again the same jsp page for now...

Is this is the correct way of doin it or....any other way...the problem that I am facing if i do it in this way is that....after submitting the login form, the page will not be reloaded so...even if there is a session exists, again the login table is being displayed...so, if i refresh it once and see...a welcome message is appearing...

if at all i am forced to go in this way....how to automatically reload the page after submitting the login form....please help me in this regard

David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

What do you mean, the page won't be reloaded after a form submission? It's a complete request cycle--*something* will be loaded, you won't just stay on the same page. Maybe you're confused because you set the session attribute after you test for its presence.

You might want to take a step back and first figure out how HTTP/request/etc. work before going to much further. And using scriptlets in JSP, and submitting to JSPs, is an antiquated coding practice--yuck.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JSP session tracking problem
 
Similar Threads
Is it possible to put a button inside autocomplete in jquery ui plugin?
How to position fieldset?
List not refreshing after submit
Getting null while trying to get value of Multiple list
Showing extra header/feature for MEMBER and GUEST