Rivka Shisman wrote:

Hi all,

I have a MessageResources.properties file that contains all the messages
regarding form validation.
I wonder what should I do when I have a business/workflow messages (like
"This entry already exist in the DB"), should I use the same properties
file? If yes - how do I call it from the business layer (say EJB layer)?
As I know, the MessageResources.properties and other message resources are visible in the Servlet Context but not outside (unless you give to your EJB layer a param where it can find them). In this case I would suggest not to use these resources in the EJB layer, but to trow exceptions and catch them in Actions and in actions to access properly these resources. For example I have "domain package" where my Business Objects are (doesn't matter if they are EJBs or not), so this layer throws some exceptions similar to that "ObjectAlreadyExist" and actions catch them and wrap with proper messages. In my opinion these messages are responsibility of the presentation layer, not in EJB layer

Borislav


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to