getMessage(Locale pLocale, String pKey, Object pArgs[])
and add my keyword replacement there also previously i only overloaded
getMessage(Locale pLocale, String pKey).... I hang my head in shame, but it is late hear so time to go home me thinks....
From: "Pat Quinn" <[EMAIL PROTECTED]>
Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Subject: Custom Message Resources
Date: Mon, 13 Jan 2003 19:52:23 +0000
Hi Guys,
Has anyone ever extended the functionality as offered by the org.apache.struts.util.RequestUtils? I want to be able to substituted keywords in my messages as loaded from my properties file with values from the database. I got this up an running by extending the MessageReources and defining my custom message factory in my Struts-config.xml.
So when getMessage() is called my keyword are loaded from the database via a thread etc.. My problem with this is as follows:
My keywords are substituted before my message keys are substituted.
Example in my properties file i have the following:
error.invalidtypes=Invalid {0} entered
//creating my ActionError
new ActionError("error.invalidtypes","#ACCOUNT");
So in my messageRecourse i have a hashMap of values as loaded from the database eg.
#ACCOUNT_EN - account code
This works fine if i had my message defined as the following in my properties file:
error.invalidtypes=Invalid #ACCOUNT entered
But i want to control the actual keyword i.e. #ACCOUNT, #SORT-CODE etc
So in short i want to check my messages for keywords (i.e. Anything starting with a #) after message keys have been substituted. After some initial investigation the best place to add this functionality would be in the RequestUtils.message() after it makes the call to resources.getMessage(userLocale, key, args)... It doesn't seem like a wise idea to extend RequestUtil..... any ideas or suggestions gratefully appreciated??
_________________________________________________________________
Help STOP SPAM: Try the new MSN 8 and get 2 months FREE* http://join.msn.com/?page=features/junkmail
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
_________________________________________________________________
Add photos to your e-mail with MSN 8. Get 2 months FREE*. http://join.msn.com/?page=features/featuredemail
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

