You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by bu...@apache.org on 2003/07/02 00:53:15 UTC

DO NOT REPLY [Bug 21250] New: - Action.getLocale does not retrieve locale from request

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=21250>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=21250

Action.getLocale does not retrieve locale from request

           Summary: Action.getLocale does not retrieve locale from request
           Product: Struts
           Version: Nightly Build
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Standard Actions
        AssignedTo: struts-dev@jakarta.apache.org
        ReportedBy: skubibugs@skubi.eu.org


This bug concerns Struts 1.1 release

Actions use Action.getLocale to retrieve the user's locale,
and other components of Struts use RequestUtils.retrieveUserLocale
for this purpose.

Action.getLocale only retrieves the locale from session.
RequestUtils.retrieveUserLocale is different: it retrieves
the locale from session, and, if nothing is found, retrieves
the locale from request.

This difference results in the following inconsistent behavior:

I want to adjust the locale on a per-request basis. Therefore, I prevent
the locale from being stored in session, as follows:

  - In struts-config.xml, I say <controller locale="false"/>
  - With <html:html>, I never say locale="true"

In this context:

   - The locale, as defined in request, is known to Struts tags, and
     I get a correctly localized button by doing this:

       <html:submit property="actionKind" title="update this element">
            <bean:message bundle="sudety" key="button.update"/>
       </html:submit>

     (The bean:message tag uses RequestUtils.retrieveUserLocale)

   - The locale is unknown to LookupDispatchAction, and the button above
     cannot be processed by said action (LookupDispatchAction
     uses Action.getLocale)


I suggest that Action.getLocale calls RequestUtils.retrieveUserLocale,
instead of doing any work by itself.

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-dev-help@jakarta.apache.org