• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JSP session tracking problem

 
Raghavender Ammagari
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic