jsp - Catch custom exception in web.xml -
how create custom exception , handle in web.xml error-page tag direct specific page.
i have tried create exception extends servlet exception this.
public class myexception extends servletexception { private static final long serialversionuid = 1l; private string[] errarray; public myexception (string[] errarray){ this.errarray = errarray; } public string[] geterrors(){ return errarray; } } then put inside web.xml
<error-page> <exception-type>my pach exception.myexception </exception-type> <location>/web_service_errorr.jsp</location> </error-page> and tried throw in project. exception still catch
<error-page> <exception-type>java.lang.throwable</exception-type> <location>/system_error.jsp</location> </error-page> at beginning of error message javax.servlet.servletexception, has root cause myexception in message.
if not doing right, how should catch custom exception , redirect jsp page?
Comments
Post a Comment