I need for my application to authenticate users.
To make thing smooth in the handling of errors & exceptions I would like to generate a HTTP 403 error (forbidden) when the user attempts to access a forbidden page.
I think that approache is more sensible than having an entry for security exception classes but also for HTTP 403.
Another related question is to know if there is a possibility to handle HTTP 4xx errors in ranges. All 4xx should be send to the DefaultErrorPage.jsp while the 404 & 403 would have specific handlings.
As far as making some errors hit a certain page, you'd have to check your webserver docs for that.
Also, you should be able to configure your error pages in your web.xml file so that it redirects to different pages based on the error codes. The catch is that this is per-application, not per application server.
I haven't done many of those in my life
No idea on how to simplify these
<!-- What follows is the handling of the HTTP-errors -->
<!-- Curently defined errors are -->
<!-- 400 : Bad Request -->
<!-- 401 : Unauthorized -->
<!-- 402 : Payment Required -->
<!-- 403 : Forbidden -->
<!-- 404 : Not Found -->
<!-- 405 : Method Not Allowed -->
<!-- 406 : Not Acceptable -->
<!-- 407 : Proxy Authentication Required -->
<!-- 408 : Request Timeout -->
<!-- 409 : Conflict -->
<!-- 410 : Gone -->
<!-- 411 : Length Required -->
<!-- 412 : Precondition Failed -->
<!-- 413 : Request Entity Too Large -->
<!-- 414 : Request-URI Too Long -->
<!-- 415 : Unsupported Media Type -->
<!-- 416 : Requested Range Not Satisfiable -->
<!-- 417 : Expectation Failed -->
into something where we don't have to have ONE entry per Exception type but where all 400's are dealed with the 4xx.jsp while only the 404 is dealed with a special JSP, say for instance.
I have now everything fine with the
How can I get the Message back in the response ?
[ March 20, 2003: Message edited by: Thomas SMETS ]