Does Struts 1.0.* version provide for having multiple message resources?
Also, how do you refer to the key values in different resource files? Do these keys have to be unique across all the properties files that are being used as message resources? So that i could use something like <bean:message key="key"/> in my jsp. Message resources seems rather confusing, in earlier examples, the properties file is passed as an init param to the action servlet. However, in newer examples, the file name pops up in the message-resources tag in struts-config.xml Would sincerely appreciate any help in this regard. My primary interest is having multiple *.properties files as resources and accesing them in my JSP using key values for bean:message tag. thanks harshad
I'm not sure about Struts 1.1beta2 but in 1.0.2, you just create translations of your english properties file and follow the ResourceBundle convention of naming those files. e.g. ApplicationResources.properties ApplicationResources_de.properties ApplicationResources_fr.properties And assuming that the files can be found under the classpath at path org.apache.struts.webapp.example; the web.xml looks like this:
<init-param> <param-name>application</param-name> <param-value>org.apache.struts.webapp.example.ApplicationResources</param-value> </init-param> So in your web page, you need to pass not only the "key" but the "locale" like this: <bean:message key=".." locale=".."> You do not need to do this if you've set your locale in the config. Pho
posted 16 years ago
Thanks Pho My purpose is not really to achieve internationalization. The messages that we have are all in English. Just that we have kept messages dealing with different issues in different *.properties files. I could use the internationlization way you have suggested to achieve this. However, that i don't think will be proper in this case.