users@glassfish.java.net

Re: Obtaining LoginException

From: <Jan.Luehe_at_Sun.COM>
Date: Thu, 02 Aug 2007 14:44:32 -0700

Hi Joe,

Shevland, Joe wrote:

>>From memory (and I think this was under Websphere), when using JSP
>form-based login and the authentication fails, I thought you could
>access a page variable (or maybe it was a request/session attribute) of
>"exception", to get at the LoginException and some details about the
>failure.
>
>Is it possible to get at the LoginException in GF when authentication
>fails?
>
>As far as I can tell in the Servlet 2.4 spec, this is as much as it
>talks about being able to provide feedback to the user as to why the
>authentication failed: "The error page sent to a user that is not
>authenticated contains information about the failure". If that's all
>there is in the spec, its pretty vague to go on when you're implementing
>your own error page.
>
>

The error information is exposed to a JSP error page via the
page context's ErrorData variable, which is populated from
the following servlet request attributes:

  javax.servlet.error.exception
  javax.servlet.error.status_code
  javax.servlet.error.request_uri
  javax.servlet.error.servlet_name

In your JSP error page, you may access this information conveniently
via the Expression Language, as follows:

  ${pageContext.errorData.throwable}
  ${pageContext.errorData.statusCode}
  ${pageContext.errorData.requestURI}
  ${pageContext.errorData.servletName}


Jan

>Cheers
>Joe
>
>This message contains information that may be privileged or confidential and is the property of the Capgemini Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message.
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
>For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>
>
>