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/02/23 03:46:29 UTC

DO NOT REPLY [Bug 17312] New: - RequestUtils.retrieveUserLocale throws Exception without Session

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=17312>.
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=17312

RequestUtils.retrieveUserLocale throws Exception without Session

           Summary: RequestUtils.retrieveUserLocale throws Exception without
                    Session
           Product: Struts
           Version: 1.1 Beta 3
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Utilities
        AssignedTo: struts-dev@jakarta.apache.org
        ReportedBy: jonstef@earthlink.net


The culprit is this call to PageContext.getAttribute:

Locale userLocale = (Locale)
   pageContext.getAttribute(locale, PageContext.SESSION_SCOPE);

It throws an IllegalArgumentException if the Session scope is invalid. I am 
working on a simple Struts application that does not require 
internationalization or the holding of Session data, so I set session="false" 
in my JSP page directives. This causes bean:write tags to fail due to the 
above restriction. Shouldn't this be handled more gracefully, as the 
retrieveUserLocale method already handles null Locale values?

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