Results 1 to 3 of 3

Thread: check if user is logged in.

  1. #1
    Join Date
    Mar 2012
    Posts
    2

    Default 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. #2

    Default

    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. #3
    Join Date
    Dec 2008
    Location
    India
    Posts
    295

    Default

    Try Spring Security or any other Security mechanism.
    Enjoy
    Rohan Chauhan
    ------------------------------------------------------------------------------
    SpringSource Certified Spring 3.0 Professional


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •