[
https://issues.apache.org/struts/browse/STR-2999?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_40575
]
Niall Pemberton commented on STR-2999:
--------------------------------------
As you say Converters are singletons so altering their properties for different
users isn't going to work. BeanUtils has "locale" versions of the Converters
(e.g. IntegerLocaleConverter) and you could set the ConvertUtilsBean instance
to be the LocaleConvertUtilsBean implementation - but the problem is that
Struts doesn't pass the Locale. I haven't actually used the "locale"
converters, but I believe there are issue with them.
Probably the only realistic option is to use String properties in your
ActionForm and handle the conversion of the values its populated with in your
Action (possibly using LocaleBeanUtils/LocaleConvertUtils.
To resolve "localized" conversion for ActionForm's in Struts would mean
providing a mechanism for Struts to use the "localized" BeanUtils and providing
the Locale to it. Currently BeanUtils is called from static RequestUtils
methods - refactoring this out into Commands in Struts 1.4 would be the first
thing to do (and which I did some work on as part of STR-2772
> Pattern override issues in struts il8n
> --------------------------------------
>
> Key: STR-2999
> URL: https://issues.apache.org/struts/browse/STR-2999
> Project: Struts 1
> Issue Type: Improvement
> Components: Core
> Reporter: Srini Vas
> Priority: Critical
>
> We are using struts framework for our web application. We need to support
> different number formats in the same application instance based on user's
> location. During parallel access since ConvertUtils is a singleton class the
> converter registered with the Pattern of first user is overridden by the
> converter with the pattern of second user.
> We couldnot introduce the logic of picking the pattern in the converter class
> itself as this class needs the user details to pick up the pattern. Did
> anyone else face a similar issue. Was there any workaround or resolution for
> this?
> Thanks in Advance.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.