Win a copy of Java 9 Modularity: Patterns and Practices for Developing Maintainable Applications this week in the Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Exception Handling  RSS feed

 
Oswald King
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
 
Vishnu Prakash
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
 
Adeel Ansari
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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!