>-----Original Message----- >From: Christopher Schultz [mailto:ch...@christopherschultz.net] >Sent: Friday, November 30, 2012 3:19 PM >To: Tomcat Users List >Subject: Re: Error page messages > >-----BEGIN PGP SIGNED MESSAGE----- >Hash: SHA1 > >Leo, > >On 11/30/12 5:09 PM, Leo Donahue - RDSA IT wrote: >>> -----Original Message----- From: Pid [mailto:p...@pidster.com] >>> Sent: Friday, November 30, 2012 3:04 PM To: Tomcat Users List >>> Subject: Re: Error page messages >>> >>> On 30/11/2012 21:00, Leo Donahue - RDSA IT wrote: >>>> Are there standardized server responses that one should expect to >>>> see >>> when dealing with java.lang, javax.servlet and javax.faces exceptions >>> that should be displayed to the client? >>> >>> You mean status codes or error pages? >> >> Error pages. >> >>> >>> If an exception isn't handled* by the app then it's 500 and a >>> stacktrace if you haven't configured a custom error page. Those >>> packages probably have a few tens of exceptions that could be thrown. >>> >>> >>>> I don't know that I would expect to see any of these on a public >>>> website, as I >>> am likely not to care what happens on the server I'm browsing, as >>> long as the server can recover/redirect. >>> >>> Catch them at the appropriate point in your code, or configure a >>> custom error page. >> >> And what kind of information does one show the user in a custom error >> page? I don't know of any public facing websites, off hand, that show >> uncaught exception messages. I was just trying to decide what I would >> show, if anything, if I configured a custom error page for certain >> types of exceptions, such as java.lang, or javax.servlet, or >> javax.faces. > >How about: > >web.xml: ><error-page> > <exception-type>java.lang.Throwable</exception-type> > <location>/WEB-INF/uncaught-error.html</location> ></error-page> > >uncaught-error.html: ><!DOCTYPE html> ><html> ><head><title>Error</title></head> ><body> > <h1>Error</h1> > <p> > Aw, crap. > </p> ></body> ></html>
Yeah, I blew off some steam playing on dev port 8080 with some fun messages just now. This whole time I thought by confusing my end users by taking them back to the web app's main page when an exception occurs was a bad idea. I really didn't want to tell them, "hey, sorry but the javax.faces.View expired because you waited too long to do something productive". > >You can put anything in there you want, man. If the stack trace seems too ugly >for you (it really is, honestly), then replace it with something else. > >Need some inspiration? Try Google. Or >http://ux.stackexchange.com/questions/15955/how-to-create-a-useful-500- >internal-server-error-page > >- -chris >-----BEGIN PGP SIGNATURE----- >Version: GnuPG/MacGPG2 v2.0.17 (Darwin) >Comment: GPGTools - http://gpgtools.org >Comment: Using GnuPG with undefined - http://www.enigmail.net/ > >iEYEARECAAYFAlC5MMQACgkQ9CaO5/Lv0PC2SwCeNW8Q8enE9m08sq9j6tYV >FRX/ >csoAniXbINKCbXd1ix+J9Nd3dHo0piLE >=EnMx >-----END PGP SIGNATURE-----