Geeks Talk

Prepare for your Next Interview




Invoke JSP error page from servlet

This is a discussion on Invoke JSP error page from servlet within the JSP forums, part of the Web Development category; Can I invoke a JSP error page from a servlet?...


Go Back   Geeks Talk > Web Development > JSP

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 05-03-2007
Junior Member
 
Join Date: Apr 2007
Location: Mumbai
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
jayalakshmic is on a distinguished road
Invoke JSP error page from servlet

Can I invoke a JSP error page from a servlet?
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 06-05-2007
Junior Member
 
Join Date: Sep 2006
Location: india
Posts: 7
Thanks: 1
Thanked 0 Times in 0 Posts
batman11 is on a distinguished road
Re: Invoke JSP error page from 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
Reply With Quote
  #3 (permalink)  
Old 06-15-2007
Junior Member
 
Join Date: Apr 2007
Location: Chennai
Posts: 15
Thanks: 0
Thanked 1 Time in 1 Post
vinotha is on a distinguished road
Re: Invoke JSP error page from servlet

hi,

u cann't invoke ,bt u can forward the response to that Error page
Reply With Quote
  #4 (permalink)  
Old 08-15-2007
Junior Member
 
Join Date: May 2007
Location: Bangalore
Posts: 19
Thanks: 0
Thanked 1 Time in 1 Post
sweet_person is on a distinguished road
Re: Invoke JSP error page from servlet

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.
Reply With Quote
Reply

  Geeks Talk > Web Development > JSP


Thread Tools
Display Modes


Similar Threads

Thread Thread Starter Forum Replies Last Post
why we shift Servlet to JSP ? psuresh1982 JSP 5 06-30-2008 09:09 AM
Access all browsers using generic servlet guptakcsg JSP 1 03-07-2007 02:30 AM
Replication of request using generic servlet guptakcsg JSP 0 03-06-2007 06:47 AM
Constructors in servlet concept JobHelper JSP 2 01-11-2007 10:10 AM
Path for storing JSP or servlet files JobHelper JSP 1 01-05-2007 12:48 PM


All times are GMT -4. The time now is 01:34 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Copyright © 2008 GeekInterview.com. All Rights Reserved