How to add a customized error page in netbeans

View: New views
2 Messages — Rating Filter:   Alert me  

How to add a customized error page in netbeans

by Mayur Valsalan :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I want a servlet page (a page with error description) to be displayed in response to a java.lang.NumberFormatExcpetion occuring in my web application. Where in NetBeans do I assign this servlet page as the error page to be invoked in case the exception occurs?

Re: How to add a customized error page in netbeans

by Marek Nowicki-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Dnia 09-05-2008 o 12:53:33 Mayur Valsalan <mayurvalsalan@...>  
napisaƂ:
> I want a servlet page (a page with error description) to be displayed in
> response to a java.lang.NumberFormatExcpetion occuring in my web
> application. Where in NetBeans do I assign this servlet page as the error
> page to be invoked in case the exception occurs?

Try add this in web.xml (web pages/WEB-INF) file:
--- CUT ---
     <error-page>
         <exception-type>java.lang.NumberFormatException</exception-type>
         <location>/pageAfterNumberFormatException.jsp</location>
     </error-page>
--- CUT ---

Or by clicking in design view of web.xml: pages/error pages/add...

regards,
Marek