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 Struts application design question 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 "Struts application design question" Watch "Struts application design question" New topic

Struts application design question

Castor Castro

Joined: Feb 03, 2008
Posts: 13
Hi guys,

Just a quick question on struts app.

How do you handle exceptions/error from the model component? My model layer will usually return values for the view. What I have in mind is the return all values as object (including primitives wrapped into their wrapper classes) and if an error is encountered, then an exception object will be returned. In the action class, i will determine if it is an exception or not. If it's not, then I will put the object to the session for access by the view (via mapping.findForward("googPage")) and if it is an exception, then I will pass to the session as well for access by the view (via mapping.findForward("badPage")).


"A quest to find the best bean in town"
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 60789

Return an exception rather than throw an exception?

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
I agree. Here's the link:
subject: Struts application design question
Similar Threads
How to set values in select box using request scope
Post-Redirect-Get pattern with Struts 2 ModelDriven action?
[Struts Recipes] Action chaining: recipe for disaster?
about struts
Display a new view page with form after submit of a Jsp page in Spring