This week's book giveaway is in the Java in General forum.
We're giving away four copies of Java by Comparison (eBook) and have Simon Harrer, Jörg Lenhard, Linus Dietz on-line!
See this thread for details.
Win a copy of Java by Comparison (eBook) this week in the Java in General forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Exception Handling  RSS feed

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all.
I just want to have your views for the exception handling.
i am dealing with some JSP pages and Beans and a Database.
** should i put my entire code for a JSP inside one try-catch block?
[your views plz]

** can i have more than one errorpage or just one errorpage for my all JSP pages? If i can't have more than one then how am i to configure that only err page for different kind of errors?

Thx
 
Ranch Hand
Posts: 1026
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


should i put my entire code for a JSP inside one try-catch block?



No necessarily.


can i have more than one errorpage or just one errorpage for my all JSP pages?



Sure, you can have as many error page as you wish as long as you configure them in web.xml
 
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1- Its better to implement MVC2 Architecture anyway.

2- You can configure you error pages in deployment descriptor. It depends what make you feel better one error page or multiple error page. I would suggest you can have one error page per error type. Or you can also have only one error page for all by ust changing the error messages.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!