This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Struts and the fly likes passing exeception Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "passing exeception" Watch "passing exeception" New topic

passing exeception

jacob deiter
Ranch Hand

Joined: Apr 02, 2008
Posts: 576
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

Joined: Feb 15, 2005
Posts: 4864
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.

Consultant, Sima Solutions
I agree. Here's the link:
subject: passing exeception
Similar Threads
Benefits of Using Spring and Struts
Struts UI layer + Spring Business layer Integration ?
Struts and JSF. What to choose to integrate with Spring and Hibernate
Container classes in Spring
Spring in the business layer