Win a copy of JDBC Workbook this week in the JDBC and Relational Databases forum
or A Day in Code in the A Day in Code 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
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

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."
 
She said she got a brazillian. I think owning people is wrong. That is how I learned ... tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic