File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes Throwing exceptions to JSP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Throwing exceptions to JSP" Watch "Throwing exceptions to JSP" New topic

Throwing exceptions to JSP

Ed Lance
Ranch Hand

Joined: Aug 02, 2000
Posts: 38
I am working on a standard model/view/controller app. The view is a JSP, the controller is a servlet and the model is a standard java class that interacts with the database. My question is how is the best way to throw exceptions from the model to the JSP. Remeber, the model is NOT a servlet. Thanks in advance.
William Brogden
Author and all-around good cowpoke

Joined: Mar 22, 2000
Posts: 12671
I suggest:
1. Always designate an errorPage for your JSP
2. have your errorPage dump a stack trace
3. debug your model class as much as possible out of the JSP environment

Java Resources at
I agree. Here's the link:
subject: Throwing exceptions to JSP
Similar Threads
Difference between Servlet, JSP and Java
Difference between these 2 methods?
Servlets Vs Struts
Servlets & MVC
passing values from jsp to servlet new jsp