4 Replies Latest reply on Jan 21, 2009 11:37 AM by manas mallik

    JAAS Login

    manas mallik Newbie

      I am using DatabaseServerLoginModule for my JAAS authentication.
      My problem is that, if the data base is down then how can i propagate the error message from the DatabaseServerLoginModule to the error jsp page.
      It is the same error jsp page which is configured for the Form based authentication in web.xml file. I have another question, how to differentiate in the error page , if the error actually happens because the user is invalid or the error comes because the data base which may be down at the time of authentication.

      I appreciate the reply.

        • 1. Re: JAAS Login
          Ragav Gomatam Novice

          Try setting the isErrorPage="true' in you jsp. The throwable should be available as an implicit object in the jsp

          • 2. Re: JAAS Login
            manas mallik Newbie

            The exception object is not available in the error page, its giving null when i print the it . The implicit exception object is exception in jsp page.

            • 3. Re: JAAS Login
              Ragav Gomatam Novice

              Implicit object "exception" should be available, we are using it & we are getting various exceptions depending on types of errors. Still, if you are unable to get it, for whatever reason then consider writing a Tomcat Valve, that intercepts the requests before it hits the web container. The JAAS exceptions should be available to the valve. You can check out the apache Tomcat website on writing a valve

              • 4. Re: JAAS Login
                manas mallik Newbie

                Hi, this is my jsp page and i just print the exception, it gives me null.
                You might be using the error jsp page in your application to catch some of the exceptions which might be thrown inside the jsp pages. But, in my case the exception is being thrown by the ServerDatabaseLoginModule and which is not reaching till the error jsp page. I will check your suggestion of Tomcat Valve. Thanks a lot.

                <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
                <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
                <%@ page isErrorPage="true" import="java.io.*" %>

                <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
                Insert title here

                exception object