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/12 19:18:05 UTC

DO NOT REPLY [Bug 17016] New: - RequestUtils.message does not check for message key not found

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

RequestUtils.message does not check for message key not found

           Summary: RequestUtils.message does not check for message key not
                    found
           Product: Struts
           Version: 1.1 Beta 3
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Enhancement
          Priority: Other
         Component: Utilities
        AssignedTo: struts-dev@jakarta.apache.org
        ReportedBy: nick.afshartous@proactcorp.com


While using the html:messages tag, I got this low-level exception
when a message key was not in the resource bundle

java.lang.NullPointerException
	at java.util.Hashtable.put(Hashtable.java:389)
	at org.apache.jasper.runtime.PageContextImpl.setAttribute
(PageContextImpl.java:229)
	at org.apache.struts.taglib.html.MessagesTag.doStartTag
(MessagesTag.java:249)

I'm wrote a patch to RequestUtils.message and this is the
new error message

javax.servlet.ServletException: Error - could not find message for key: 
errors.required
	at org.apache.jasper.runtime.PageContextImpl.handlePageException
(PageContextImpl.java

Patch follows
---------------

949a950,951
>         String message = null;
> 
951c953
<             return (resources.getMessage(userLocale, key));
---
>             message = (resources.getMessage(userLocale, key));
953c955
<             return (resources.getMessage(userLocale, key, args));
---
>             message = (resources.getMessage(userLocale, key, args));
955a958,964
>         if (message == null) {
>             throw new JspException("Error - could not find message for key: "
>                                    + key);
>         }
> 
>         return message;
>

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