Win a copy of Java Concurrency Live Lessons this week in the Threads forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

session in jsp  RSS feed

 
sihani rani
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1) i create a jsp login page...
that contain username and password..

2) i click "submit" button then it goes to "login"-servlet...

3)in this login servlet ,it check username and password with databse..

4)if it's true,then create session and set session attribute for username.password...then it goees to home.jsp

my question is ,
home.jsp session and login servlet session are same or different???


if it different ,then how to create session in jsp..




please reply me..
yhanks in advance..
 
shreyansh jain
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can check by getting the value of session in both pages by using session.getId() mehtod.
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A JSP will create a session by default unless you've explicitly directed it not to.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!