Thanks, everyone. This worked!
----- Original Message ----- From: "Shishir K. Singh" <[EMAIL PROTECTED]> To: "Struts Users Mailing List" <[EMAIL PROTECTED]> Sent: Wednesday, January 07, 2004 9:47 AM Subject: RE: Resources from ActionForm Ooops..I am sorry. I think you can do MessageResources resource = (MessageResources) servlet.getServletContext().getAttribute("PORTAL_RESOURCES"); servlet is a protected field in ActionForm and hence accesible. Shishir -----Original Message----- From: Shishir K. Singh Sent: Wednesday, January 07, 2004 10:20 AM To: 'Struts Users Mailing List' Subject: RE: Resources from ActionForm I think the messageresources is stored in the the application context. Don't know if you can access the application context in the form. One way would be to subclass RequestProcessor, put a static function to get the resource and use that. I would have been happier if an extra function could have been provided in ActionMessage or ActionError like getMessage() which would have returned the full message after substitution. -----Original Message----- From: Matthias Wessendorf [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 07, 2004 9:50 AM To: 'Struts Users Mailing List'; 'e-denton Java Programmer' Subject: RE: Resources from ActionForm hi, in an actionForm.validate(): MessageResources res = (MessageResources) request.getAttribute(GLOBALS.MESSAGES_KEY); //thats default-key String foo = res.getMessage("my_Key_In_bundle"); //get an message greetings -----Original Message----- From: e-denton Java Programmer [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 07, 2004 3:42 PM To: Struts Users Mailing List Subject: Resources from ActionForm Hi, I want to access a resource bundle (key=PORTAL_RESOURCES) from an ActionForm to pull out display names for error messages (ActionError). I can't see how to access the resource bundle and pull out the strings I want. Thanks for your help. Will --------------------------------------------------------------------- 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] --------------------------------------------------------------------- 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]