The pattern matching exception handler Wouter mentioned allows you to throw an 
exception from your business tier, that has a pattern like the following: 



throw new PersonServiceException("{person.unique.id.required} A unique name 
must be specified!").



Then within your custom-resources.properties (which are merged into your 
application-resources.properties you'd have the key defined:



person.unique.id.required=Please enter a unique name when attempting to create 
a Person.



So when this exception is thrown the pattern matching exception handler checks 
to see if it can find a pattern in the exception message "{some.key}".  If it 
can, it, it extracts and looks up the key from the message resources and saves 
the message which is then shown as a struts error to the client. If the pattern 
is not found, the exception is propagated up to the client as usual.
--
Chad Brandon - [EMAIL PROTECTED]

http://www.andromda.org
_________________________________________________________
Reply to the post : http://galaxy.andromda.org/forum/viewtopic.php?p=1008#1008
Posting to http://forum.andromda.org/ is preferred over posting to the mailing 
list!


-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games.  How far can you shotput
a projector? How fast can you ride your desk chair down the office luge track?
If you want to score the big prize, get to know the little guy.  
Play to win an NEC 61" plasma display: http://www.necitguy.com/?r=20
_______________________________________________
Andromda-user mailing list
Andromda-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/andromda-user

Reply via email to