2 Replies Latest reply on Feb 9, 2007 3:04 AM by Kristof Devos

    get loginexception back

    Kristof Devos Newbie

      Hi,

      We use our own JAAS login module which throws a loginexception where we added some extra info on the error occurred (user blocked, inactive, etc)

      How can we retrieve the loginexception? The app is redirected to the page configured in the form-error-page (web.xml) but we cannot retrieve the exception

      thx

        • 1. Re: get loginexception back
          John Hudson Newbie

          If you have access to the session then you possible have access to the j_exception attribute...

          I am using Struts so I first check if j_exception is in the session with: (in your JSP):

          <logic:present name="j_exception">
           ...
           </logic:present>


          if it is in the session, grab the object and use it:

          <%
           LoginModuleException f = (LoginModuleException)session.getAttribute("j_exception");
           if (f.getType()==0){
           %>Check your Username / Password<br /><%
           } else if (f.getType()==1) {
           %>Check you are not logged in on another device<br /><%
           }
           %>


          hope this helps

          • 2. Re: get loginexception back
            Kristof Devos Newbie

            idd we did quite the same

            tried also with a filter but apparently filters are not executed on j_security_check

            thx for the reply