Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

cookie and login

 
Jigar Naik
Ranch Hand
Posts: 762
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have created a small application where first apears a login page and than user should be able to access other pages.

how do i stop user from direct accessing other pages.

like this is the url of login page


and user should not be able to access the c_voucher link before going through login page.



how do i achieve that
 
Rao Raghu
Ranch Hand
Posts: 100
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
By maintaining sessions.

You can retrieve his username and assign it to a hidden-type and validate the same before each page displays the contents. Better to use servlets.
 
Jigar Naik
Ranch Hand
Posts: 762
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can you please explain in more detail.
 
Rao Raghu
Ranch Hand
Posts: 100
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When the user logs-in retrieve his username like:



now set this as a hidden type:



In the next jsp validate it like:



this is a rough presentation, i hope you might have got the concept now.

 
Jigar Naik
Ranch Hand
Posts: 762
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ye gotcha... Thanks a lot
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you haven't already, read up on filters.

They're perfect for this because they can be applied to both static and dynamic content vi configurations settings in your web.xml file.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic