Rather than modifying RequestUtils why not configure Struts to use your own MessageResources implementation:
http://jakarta.apache.org/struts/userGuide/configuration.html 1) Extend PropertyMessageResources setting the returnNull property to 'true' in the constructor and overriding the getMessage() method public class MyMessageResources extends PropertyMessageResources { // N.B. calls parent class constructor with returnNull = true public MyPropertyMessageResources(MessageResourcesFactory factory, String config) { super(factory, config, true); } public String getMessage(Locale locale, String key) { String msg = super.getMessage(locale, key); return msg == null ? "keynotFound.message" : msg; } } 2) Create a Factory for your MessageResources implementation public class MyMessageResourcesFactory extends MessageResourcesFactory { public MessageResources createResources(String config) { return new MyMessageResources(this, config); } } 3) Configure Struts to use your MessageResources class. In the struts-config.xml <message-resources parameter="...." factory="mypackage.MyMessageResourcesFactory "/> Niall ----- Original Message ----- From: <[EMAIL PROTECTED]> To: "struts-user" <[EMAIL PROTECTED]> Sent: Friday, June 18, 2004 10:03 AM Subject: help message resources Hi, i 'm tring to change the message visualization (i don't want to show the user a message like '???foo???') when the key of the message is not present in my ApplicationResources files. how can i do ? The only solution i found is to modify the method message(pageContext, bundle, locale, key, args[]) of the RequestUtils class adding at the end the following lines: if(result.startWith("???") && result.endWith("???")){ result= (resources.getMessage(userLocale,"keynotFound.message"); } Is there cleaner way to do this??? Thanks. Ale --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]