Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Loading Driver.

 
swapna manne
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • 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?
 
Adeel Ansari
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
  • 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.
 
Nikhil Menon
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • 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
  • 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."
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic