Can I invoke a JSP error page from a servlet?
Printable View
Can I invoke a JSP error page from a servlet?
i guesss u will need to code the jsp page which u wanna diplay through tht servlet or use forward to move to thte perticulat jsp
hi,
u cann't invoke ,bt u can forward the response to that Error page
Yes we can do this. you need to write
<error-page>
<exception-type>javax.sql.SQLException</eception-type>
<location>error.jsp</location>
</error-page>
Just add the above code to web.xml file and when ever an SQLException is raised and not handled in the Servlet it will check in the web.xml for this exception and will be handled by the page (may be servlet also) given in the location sub-element.