hi again in my validate() this gets default-messageResources:
MessageResources m = (MessageResources) request.getAttribute(Globals.MESSAGES_KEY); System.out.println(m.getMessage("myKey")); and that an alternative Resource: (this servlet(application)-context...) sorry... wrong in mind :-( MessageResources ms = (MessageResources) getServlet().getServletContext().getAttribute("alternativ"); System.out.println(ms.getMessage("myKey")); -----Original Message----- From: Shishir K. Singh [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 07, 2004 4:20 PM 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]