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 2001/11/13 14:42:13 UTC

DO NOT REPLY [Bug 4836] New: - org/apache/struts/util/LocalStrings message format wrong

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

org/apache/struts/util/LocalStrings message format wrong

           Summary: org/apache/struts/util/LocalStrings message format wrong
           Product: Struts
           Version: Nightly Build
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Custom Tags
        AssignedTo: struts-dev@jakarta.apache.org
        ReportedBy: d.m.t@gmx.net


org/apache/struts/util/LocalStrings has a messed up formating entry for 
parameters.multi. When specifying a name attribute for &lt;html:link&gt; that 
doesn't resolve to a Map you'll get an IllegalArgumentException in 
java.text.MessageFormat instead of the actual error message. Attached diff 
against the cvs version should make it clear. 

This being my first bug report I hope that it's useful to someone.

diff -u -1 -r1.4 LocalStrings.properties
--- LocalStrings.properties     2001/10/16 17:15:25     1.4
+++ LocalStrings.properties     2001/11/13 13:14:15
@@ -11,3 +11,3 @@
 message.bundle=Cannot find message resources under key {0}
-parameters.multi=Cannot cast to Map for name={0} property={1e} scope={2}
+parameters.multi=Cannot cast to Map for name={0} property={1} scope={2}
 parameters.single=Cannot cast to String for name={0} property={1} scope={2}

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


html:link using bean parameters (was: DO NOT REPLY [Bug 4836] New: - org/apache/struts/util/LocalStrings message format wrong)

Posted by Daniel Temme <d....@gmx.net>.
Hi,

> parameters.multi. When specifying a name attribute for &lt;html:link&gt;
> that doesn't resolve to a Map you'll get an IllegalArgumentException in
> java.text.MessageFormat instead of the actual error message. 

while I'm at it... The reason that I actually stumbled across this was that I 
was trying to append the properties of a bean to the link parameters. 

Now I'm curious whether it would be possible to extend the functionality of 
RequestUtils to also handle this case.

I've attached a diff that should illustrate this and so far seems to work for 
me. (Although I'm not sure about the exception handling.)

Have a nice day
Daniel Temme