At 2005-07-25 08:20, you wrote:
Hi all,
I wonder whether or not the Messages files (*.properties) in Struts
support a message definition form like a config file of Smarty or not?
in Smarty config file:
[loginForm]
username=User name:
firstname=First name:
[userHome]
hello=Hello
.... so, with above definition form, we can call specific message
group that we need. For example, if we only need messages for Login Form.
Seems this could be a job for the sandbox component i18n
(http://jakarta.apache.org/commons/sandbox/i18n/), which I am
currently working on. One of the advantages of i18n over Resources is
that you can group messages together using a common ID ("loginForm").
You could write your own implementation of the MessageProvider
interface, that parses Smarty files into i18n messages (if you do,
please consider contributing it). You could then easily create your
own JSP tags to use these messages (I could guide you here if needed).
On the other hand, you may be able to achieve what you want by simply
prepending the "group". I.e.
loginForm.username=User name:
loginForm.firstname=First name:
userHome.hello=Hello
Mattias Jiderhamn
Expert Systems
Mail:
<mailto:[EMAIL PROTECTED]>[EMAIL PROTECTED]
Web: <http://www.expertsystem.se/>www.expertsystem.se
Skype: <callto://mattiasj78>mattiasj78