• Post Reply Bookmark Topic Watch Topic
  • New Topic

Struts application design question  RSS feed

 
Castor Castro
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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")).

Thanks
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65833
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Return an exception rather than throw an exception?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!