• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Loading Driver.

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
What happens if i load Diiferent drivers at same time.........

like
Class.forName("type one driver");
Class.forName("type four driver");
and How to open Error page of Jsp from a servlet?
 
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
- Both will be loaded.

- forward to error page from your servlet using RequestDispatcher. Or make an error page entry in your deployment descriptor. Both would work fine.
 
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

originally posted by Adeel Ansari
- forward to error page from your servlet using RequestDispatcher. Or make an error page entry in your deployment descriptor. Both would work fine.



1.If you use RequestDispacther to forward to an 'jsp error page' then you have to set the request attribute asrequest.setAttribute("java.servlet.jsp.jpsException",e) and then forward('e' is your exception object). Advantage of doing so is can get the exception object in your error page too as the jsp implicit object 'exception'. Then you do stack trace or handle it in your way.

2.If you use deployment descriptor then it works fine and is easier.

Nikhil Kanjulli Menon
 
Adeel Ansari
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Nikhil Menon:
1.If you use RequestDispacther to forward to an 'jsp error page' then you have to set the request attribute asrequest.setAttribute("java.servlet.jsp.jpsException",e) and then forward('e' is your exception object). Advantage of doing so is can get the exception object in your error page too as the jsp implicit object 'exception'. Then you do stack trace or handle it in your way.



How it sounds?

"The isErrorPage attribute indicates if the current JSP page is
intended to be an error page for other JSP. If true, then the implicit scripting variable exception is defined, and its value is a reference to the offending Throwable object. If the isErrorPage attribute value is false, then the exception implicit variable is unavailable."
 
I will open the floodgates of his own worst nightmare! All in a tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic