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/01/30 21:13:03 UTC

DO NOT REPLY [Bug 16617] New: - html:messages tag does not get MessageResources correctly

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

html:messages tag does not get MessageResources correctly

           Summary: html:messages tag does not get MessageResources
                    correctly
           Product: Struts
           Version: 1.1 Beta 3
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Major
          Priority: Other
         Component: Utilities
        AssignedTo: struts-dev@jakarta.apache.org
        ReportedBy: elyb1@horacemann.com


If the html:messages tag is used in a configuration with multiple modules it 
does not function correctly. The reason is that the MessageResources not loaded 
from the correct scope.

1)MessageResources are loaded into the request scope when entering action.
2)Call to MessagesTag sends call to RequestUtils.message with the bundle named
by Globals.MESSAGES_KEY.
3)Because bundle param is not null, the RequestUtils.message method never looks 
in the request attributes and skips to the application scope attributes where 
the given key does not exist.
4)RequestUtils.message returns 'null'.
5)MessagesTag attempts to put a null value into the PageContext (which on my 
setup is a Hashtable and errors with NPE).

This can be fixed by defaulting MessagesTag bundle field to null or by allowing 
RequestUtils.message to search all scopes after setting the default bundle 
name. I chose the latter for my patch.

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