I don't have any web framework. I'm using JQuery with JAX-RS. So jquery posts/gets from the JAX-RS layer.
The SecurityException is related to a person trying to hack the system. Thus, when they perform their attempted hack the code simply throws a SecurityException, and takes them to a, "we know what you are trying to do page". To me it seems reasonable. All other exceptions are handled in the code as one would expect. Generally, a RuntimeException is used when recovery is not possible. That is the case here, and why a RuntimeException has been thrown. However, I will try creating a checked Exception subclass and see if that fixes the problem. Thanks for the response. Bryan > From: yucca...@live.co.za > To: users@tomcat.apache.org > Subject: Re: error-page exception-type subclasses of RuntimeException are not > handled > Date: Wed, 12 May 2010 09:03:30 +0200 > > I am not too sure on this, but it could be because runtime exceptions are > usually avoidable and perhaps therefore you need to deal with such errors > beforehand(higher up in the stack) and throw custom exceptions. It doesn't > sound like good coding standards(what you are doing anyway). If you are > using JSF you can use<from-outcome> to control views for user error to > redirect them to error page. > > -------------------------------------------------- > From: "bryan jacobs" <bryancjac...@hotmail.com> > Sent: Wednesday, May 12, 2010 12:56 AM > To: <users@tomcat.apache.org> > Subject: error-page exception-type subclasses of RuntimeException are not > handled > > > > > > > Tomcat Version: apache-tomcat-6.0.26 > > > > JDK: jdk1.6.0_19 > > > > OS: Windows XP Service Pack 2 > > > > I am using the <page-error> element in my web.xml with the > > <exception-type> element which contains a subclass of RuntimeException. > > > > When I subclass RuntimeException the <location> element which specifies my > > error-page to land on in the event that exception is raised is not > > displayed. > > > > > > web.xml snippet: > > > > <error-page> > > > > <exception-type>org.lds.lua.directory.exception.LuaSecurityException</exception-type> > > <location>/error.html</location> > > </error-page> > > > > Where LuaSecurityException extends RuntimeException > > > > When my JAX-RS method throws the LuaSecurityException the error.html is > > NOT displayed. > > > > However, if I change the above configuration to: > > > > > > > > <error-page> > > > > > > <exception-type>java.lang.RuntimeException</exception-type> > > > > <location>/error.html</location> > > > > </error-page> > > > > and have my class throw a RuntimeException then the error.html page is > > displayed. > > > > Finally if I change the web.xml to: > > > > <error-page> > > > > > > > > <exception-type>java.lang.Exception</exception-type> > > > > > > <location>/error.html</location> > > > > > > </error-page> > > > > and my jax-rs class throws a LuaSecurityException extends RuntimeException > > then my error.html is displayed. > > > > What I would like to do is: > > <error-page> > > > > > > <exception-type>org.lds.lua.directory.exception.LuaSecurityException</exception-type> > > > > <location>/error.html</location> > > > > </error-page> > > > > That way I can create various RuntimeException subclasses which are > > appropriate for my application and handle them with specific error pages. > > > > Any help would be appreciated. > > > > If you need more information please let me know. > > > > Bryan > > > > _________________________________________________________________ > > Hotmail is redefining busy with tools for the New Busy. Get more from your > > inbox. > > http://www.windowslive.com/campaign/thenewbusy?ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_2 > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org > For additional commands, e-mail: users-h...@tomcat.apache.org > _________________________________________________________________ The New Busy is not the old busy. Search, chat and e-mail from your inbox. http://www.windowslive.com/campaign/thenewbusy?ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_3