Forums Register Login

Using JSTL fmt to localize, can I access message bundle from Java class?

+Pie Number of slices to send: Send
Is it possible to access the message bundles from within a Java class (not from a jsp page)?
+Pie Number of slices to send: Send
The JSTL fmt classes are built using the exact same facilities that you'd use in your code. So, yes you can set up your bundles to be accesbile by both Java code and JSTL.
[ March 22, 2007: Message edited by: Bear Bibeault ]
+Pie Number of slices to send: Send
 

Originally posted by Bear Bibeault:
The JSTL fmt classes are built using the exact same facilities that you'd use in your code. So, yes.




For example, from my jsp page, I have:


From a POJO, how do I retrieve the Spanish translation of the mypage.mygreeting key in the message bundles. For instance, I want to retrieve the Spanish version from messages_es.properties.

[ March 22, 2007: Message edited by: timothy chan ]
[ March 22, 2007: Message edited by: timothy chan ]
+Pie Number of slices to send: Send
That's not a JSP topic, but I suggest you research the classes such as PropertyBundle in the java.util packages.
[ March 22, 2007: Message edited by: Bear Bibeault ]
Get me the mayor's office! I need to tell him about this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 938 times.
Similar Threads
singleton
How to represent the message ?
calling a bean object from a servlet into a plain java class
Does any 1 know abt jar files .....
About class access modifiers
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 18, 2024 20:48:51.