0 Replies Latest reply on Feb 21, 2013 10:45 PM by haisheng mi

    how to get AuthenticationStatus in a jsp page?

    haisheng mi Newbie

      i use jsp page,not jsf.


      i want to know AuthenticationStatus in a jsp page.


      for example, i inject HttpSession session into Authenticator Class.


      public class SimpleAuthenticator extends BaseAuthenticator implements Authenticator {

         @Inject Credentials credentials;

         @Inject HttpSession session;


         public void authenticate() {

            if ("demo".equals(credentials.getUsername()) &&

                  credentials.getCredential() instanceof PasswordCredential &&

                  "demo".equals(((PasswordCredential) credentials.getCredential()).getValue()))  {


               setUser(new SimpleUser("demo"));



               session.setAttribute("islogin", "YES");// i keep islogin status in session





                session.setAttribute("islogin", "NO");





      my question is:

      after user login succeed and before session timeout,

      if AuthenticationStatus is same width session("islogin")?