Author |
Message |
22/08/2012 13:29:11
|
bthalheim
Power User
Joined: 05/04/2012 11:45:24
Messages: 72
Offline
|
Hi,
a normal MessageSource allows me to do this:
Code:
org.springframework.context.MessageSource.getMessage(String, Object[], Locale)
With the normal CaptainCasa resource mechanism I can only use static messages, and I cannot fill in any arguments into placeholders.
So my first question is: Have I simply not discovered that args-Feature in the resource mechanism of CaptainCasa or is this really not possible?
Thanks,
Björn
|
|
|
22/08/2012 16:08:15
|
CaptainCasa
Power User
Joined: 21/11/2007 12:23:06
Messages: 5555
Offline
|
Hi,
I am not sure what "normal" is ;-)
We are using the properties management within Java by default.
What you should do is:
Derive the message, e.g. "$1 has been processed."
Then use String.replace to fill in "$1" or whatever you use.
...and of course you can shrinkwrap this in an own Util-method.
Regards, Björn
|
Björn Müller, CaptainCasa GmbH |
|
|
23/08/2012 11:16:18
|
bthalheim
Power User
Joined: 05/04/2012 11:45:24
Messages: 72
Offline
|
Hi,
it seems I have not expressed myself good enough.
As long as I am in my code, args are no Problem ...
But when i am in my JSP, I do the following:
Code:
<... text="#{rr.resource['message_key']}"
If I have then defined in resources.properties ...
Code:
message_key=Message with Placeholder {0} inside
... I cannot pass an argument to be filled into the placeholder. The resource mechanism does not seem to give me a chance to pass args into the tag. I guess this is simply a fact, isn't it?
Regards,
Björn
|
|
|
23/08/2012 11:20:53
|
CaptainCasa
Power User
Joined: 21/11/2007 12:23:06
Messages: 5555
Offline
|
...yes, this is a fact as you describe it...
Regards, Björn
|
Björn Müller, CaptainCasa GmbH |
|
|
|