This week's book giveaways are in the Cloud and AI/ML forums.
We're giving away four copies each of Cloud Native Patterns and Natural Language Processing and have the authors on-line!
See this thread and this one for details.
Win a copy of Cloud Native PatternsE this week in the Cloud forum
or Natural Language Processing in the AI/ML forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Knute Snortum
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Piet Souris
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

Loading Driver.

 
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?
 
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.
 
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."
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!