Struts message mechanism use Java ResourceBundle to load language bundle resource, it's follow Java ResourceBundle's rule. I would like to recommend you to look at Java's Internationalization technic http://java.sun.com/docs/books/tutorial/i18n/resbundle/index.html
Struts offer configuration for resource bundle and make it easy for useing. 1.You also could put other place, but make sure your class load could find it. 2. You can have more thant message-resource element in configuration file. and for other bundle, you have to put key attribute <message-resources parameter="com.maveo.action.language.AdminSiteMain" key="mainResource" null="false"/> where you can use it as <bean:message key="title.login" bundle="mainResource"/> On Thu, 20 Jan 2005 14:51:29 -0600, Scott Purcell <[EMAIL PROTECTED]> wrote: > Hello, > > I am having trouble understanding how the message tag and the resource bundle > work together. > > Let me try and summarize. I have gone through the O'Reilly book and I see how > the resoruce bundle and the bean:message tag work, but would like a little > more in-depth understanding: > > In a jsp I have a link like this: > <title><bean:message key="title.login"/></title> > And when I look at the struts-config.xml I have this entry > <struts-config> > > <controller > contentType="text/html;charset=UTF-8" > debug="3" > locale="true" > nocache="true"/> > > <message-resources parameter="globalResources" null="false"/> > > </struts-config> > > And when I look around I find the "globalResources.properties" file under > /WEB-INF/classes > > And I see how the above call brings in the value of title.login. > > All that makes sense. So my question is as follows: > 1) Why does the globalResources.properties live under /WEB-INF/classes? Is > there a way to configure this differently? > 2) The book says the following: > The message tag is one of the most widely used tags within teh Struts tab > libraries. It recives an internationalized message for the specified locale, > using the specified message key, and writes it to the output stream. > I could use some clarification as to what that statement means. > I interpret it, as I can use a .properties file for different messages?? > > If someone who understands this better could give me a hand, I would > appreciate. > > Sincerely, > Scott > > -- Anthony Hong --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]