File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

passing exeception

 
jacob deiter
Ranch Hand
Posts: 580
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I use spring,HIbernate and struts 1.2 in my application.Spring fit into business layer. I have to display user friendly message to user when a exception raised in business layer(spring layer).How I pass the exception raised in service layer(spring) to Struts.
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just have your model classes throw any exceptions they may encounter. Then have your Struts Action class catch the exceptions and convert them to user-friendly messages that can be displayed in the JSP.

Another alternative would be to have the Action class also throw messages and declare global message handlers in the struts-config.xml file to handle specific messages and display specific JSPs when they occur.
 
Consider Paul's rocket mass heater.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic