Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JSP: check if user is logged on

 
Vivek Kr Agrawal
Ranch Hand
Posts: 51
Eclipse IDE Java Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am creating a small project (CRUD) for my college in JSP. The problem is that a user can create,read,update and delete items only after he gets logged in. I have created all things and its working all fine. But how can I check that this is a logged user or not in my every jsp page.
If it is not a logged one then it should be redirected to index.jsp.
I know I have to session variables but don't know how to use it? Please also provide me the best coding practice to write this code once and include in all subsequent files.

Thanks in advance!!
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64192
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Servlet filter.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic