RE: Message resource as a String variable
You mean like this? bean:define id=myVar bean:message key=someKey/ /bean:define -- James Mitchell Software Engineer / Struts Evangelist http://www.struts-atlanta.org 678.910.8017 AIM:jmitchtx -Original Message- From: Suresh Addagalla [mailto:[EMAIL PROTECTED] Sent: Friday, September 05, 2003 3:15 AM To: 'Struts Users Mailing List' Subject: Message resource as a String variable Hi, Is it possible to create a String variable out of a message resource defined in the resources files? bean:message doesn't seem to help. Thanks, Suresh **Disclaimer** ** Information contained in this E-MAIL being proprietary to Wipro Limited is 'privileged' and 'confidential' and intended for use only by the individual or entity to which it is addressed. You are notified that any use, copying or dissemination of the information contained in the E-MAIL in any manner whatsoever is strictly prohibited. ** * - 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 as a String variable
Yep, Use one of the getMessae methods on the MessageResources class. http://jakarta.apache.org/struts/api/org/apache/struts/util/MessageResou rces.html The locale is fetched from a session attribute. Here is an example: Locale locale = (Locale) session.getAttribute( Action.LOCALE_KEY ); MessageResources messages = servlet.getResources(); String message = messages.getMessage( locale, important.message ); Regards Lasse -Original Message- From: Suresh Addagalla Sent: fr 2003-09-05 09:15 To: 'Struts Users Mailing List' Cc: Subject: Message resource as a String variable Hi, Is it possible to create a String variable out of a message resource defined in the resources files? bean:message doesn't seem to help. Thanks, Suresh **Disclaimer Information contained in this E-MAIL being proprietary to Wipro Limited is 'privileged' and 'confidential' and intended for use only by the individual or entity to which it is addressed. You are notified that any use, copying or dissemination of the information contained in the E-MAIL in any manner whatsoever is strictly prohibited. *** - 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]