Question regarding on how to show other errors thanfalseusername/password
Christian Haugen
christian.haugen at agresso.no
Tue Jul 10 03:39:43 EDT 2007
No worries... Change the java.lang.Exception.RuntimeException to
.java.lang.RuntimeException and it works! :-)
________________________________
From: cas-bounces at tp.its.yale.edu [mailto:cas-bounces at tp.its.yale.edu]
On Behalf Of Christian Haugen
Sent: 9. juli 2007 17:42
To: Yale CAS mailing list
Subject: RE: Question regarding on how to show other errors
thanfalseusername/password
Thanks!
I can still not get it to work though.. I implement a runtimeerror that
occurs when the database cannot be contacted. I tried catching it in the
casLoginForm.jsp but that didn't work.
So I tried to define new <error-pages> in the web.xml file but cannot
seem to get it to work.
I removed the
<error-page>
<exception-type>java.lang.Exception</exception-type>
<location>/WEB-INF/view/jsp/errors.jsp</location>
</error-page>
And replaced it with a
<error-page>
<exception-type>java.lang.Exception.RuntimeException</exception-type>
<location>/WEB-INF/view/jsp/dberrors.jsp</location>
</error-page>
But I only get a message that there has been a runtimeexception that
obviously has not been handled. Is there anything else I have to edit so
the <error-page> tags in web.xml works?
Thank you so much,
Christian Haugen
________________________________
From: cas-bounces at tp.its.yale.edu [mailto:cas-bounces at tp.its.yale.edu]
On Behalf Of Scott Battaglia
Sent: 5. juli 2007 21:06
To: Yale CAS mailing list
Subject: Re: Question regarding on how to show other errors than
falseusername/password
If you're throwing a CAS authentication expection (and you extend the
AuthenticationException class) any value in the "code" field is mapped
back to a message in the message.properties that will be displayed on
the login page.
Otherwise, if you throw a RuntimeException (or something that extends a
RuntimeException) it should be propagated up and you can either use
J2EE's exception handling mechanisms or Springs.
-Scott
On 7/5/07, Christian Haugen <christian.haugen at agresso.no> wrote:
Hi!
Let's say that my database is down, how do I get that message across to
the user? When the pasword and username is validatet it replies with a
boolean answer. I want to do something similar for when I get a reply
from the db signifying that something is not right.
Lets say I return an DBok or a DBnok depending on whether the database
is up and running or not, where would I link this to an dberror.jsp in
the view folder?
Thank you so much in advance..
Christian
_______________________________________________
Yale CAS mailing list
cas at tp.its.yale.edu
http://tp.its.yale.edu/mailman/listinfo/cas
--
-Scott Battaglia
LinkedIn: http://www.linkedin.com/in/scottbattaglia
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://tp.its.yale.edu/pipermail/cas/attachments/20070710/1ed443ac/attachment.html
More information about the cas
mailing list