I have to display a date in the format 'MMMM dd, yyyy'. This works only when the locale carries 'en' as the language. It shows English names for months even though the locale has been changed to French, Canada.
The following is the code I have written in my jsp.
I am changing the locale in the session with the attribute named under Globals.LOCALE_KEY.
I read under the struts tag reference the following comment,
If format attribute exists then value will be formatted on base of format string from format attribute and default system locale.
What does default system locale mean, is it the locale of the OS?
I didn't tried i18n in Struts, its just guess workaround I was giving.
Ratish Vichithran wrote:But that's fine. I found a work around.
I created a class with a static method and the parameters to the method are the locale, date value and the format. And I called that method in my jsp.
And better you called that Utility class at server side action class before setting the bean properties, because its ill practice to call Java code in JSP. Don't use Scriptlets
subject: bean:write not using locale settings while formatting a date value.