Announcement Announcement Module
No announcement yet.
check if user is logged in. Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • check if user is logged in.

    can anyone please help how can i check if a user is logged in.... i want form authentication wherein some jsp pages cannot be access if the user is not logged in. thats now the only problem of my web app..

  • #2
    Look at the API for HttpServletRequest. It has a method to getUserPrincipal() which will be non null value if users are authenticated.

    There might be other ways also depending on the security framework you use, but all of them would be setting the user principal value on the request object during successful authentication.


    • #3
      Try Spring Security or any other Security mechanism.