RE: Message Resource Bundle from an action
From the example app: http://cvs.apache.org/viewcvs.cgi/jakarta-struts/src/example/org/apache/ struts/webapp/example/EditRegistrationAction.java?rev=1.10content-type= text/vnd.viewcvs-markup public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { // Extract attributes we will need Locale locale = getLocale(request); MessageResources messages = getResources(request); -- James Mitchell Software Engineer/Struts Evangelist http://www.open-tools.org/ The man who does not read good books has no advantage over the man who cannot read them. - Mark Twain (1835-1910) -Original Message- From: Pat Quinn [mailto:[EMAIL PROTECTED]] Sent: Monday, February 03, 2003 9:50 AM To: [EMAIL PROTECTED] Subject: Message Resource Bundle from an action hi guys, Anyone know how i can access the message resource bundle from an action class?? Cheers Pat _ Tired of spam? Get advanced junk mail protection with MSN 8. http://join.msn.com/?page=features/junkmail - 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]
Re: Message Resource Bundle from an action
An snip of my code for Struts 1.0.2 String mensaje = ; MessageResources resources = (MessageResources) servlet.getServletContext().getAttribute(Action.MESSAGES_KEY); if (resources == null) mensaje = fichero de propiedades no encontrado; else mensaje = resources.getMessage(getLocale(request), e.getMessage()); System.out.println(mensaje); I guess for Struts 1.1b* would be quite close Adolfo From: Pat Quinn [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: Message Resource Bundle from an action Date: Mon, 03 Feb 2003 14:50:10 + hi guys, Anyone know how i can access the message resource bundle from an action class?? Cheers Pat _ Tired of spam? Get advanced junk mail protection with MSN 8. http://join.msn.com/?page=features/junkmail - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ Add photos to your messages with MSN 8. Get 2 months FREE*. http://join.msn.com/?page=features/featuredemail - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Message Resource Bundle from an action
Cheers for that i forgot my locale setting thats why it blew up on me From: James Mitchell [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Subject: RE: Message Resource Bundle from an action Date: Mon, 3 Feb 2003 09:56:42 -0500 From the example app: http://cvs.apache.org/viewcvs.cgi/jakarta-struts/src/example/org/apache/ struts/webapp/example/EditRegistrationAction.java?rev=1.10content-type= text/vnd.viewcvs-markup public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { // Extract attributes we will need Locale locale = getLocale(request); MessageResources messages = getResources(request); -- James Mitchell Software Engineer/Struts Evangelist http://www.open-tools.org/ The man who does not read good books has no advantage over the man who cannot read them. - Mark Twain (1835-1910) -Original Message- From: Pat Quinn [mailto:[EMAIL PROTECTED]] Sent: Monday, February 03, 2003 9:50 AM To: [EMAIL PROTECTED] Subject: Message Resource Bundle from an action hi guys, Anyone know how i can access the message resource bundle from an action class?? Cheers Pat _ Tired of spam? Get advanced junk mail protection with MSN 8. http://join.msn.com/?page=features/junkmail - 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] _ Tired of spam? Get advanced junk mail protection with MSN 8. http://join.msn.com/?page=features/junkmail - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]