[prev in list] [next in list] [prev in thread] [next in thread] 

List:       taglibs-user
Subject:    Re: <fmt:param> not working as expected...
From:       Pierre Delisle <Pierre.Delisle () Sun ! COM>
Date:       2003-09-26 21:00:40
[Download RAW message or body]

From bug #14590:
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=14590

  ...
  This is not a bug in JSTL, but a peculiarity of how a single
  quote is interpreted by java.text.MessageFormat.

  For more details, you may want to check bug
  reports 4293229 and 4321513 in the java bug database
  (http://developer.java.sun.com/developer/bugParade).

  The simple rule is as follows:
  If there is a {0} placeholder in a message string, 
  single quotes have to be doubled.

    -- Pierre


Billy Bacon wrote:

> Nope, I'm not using Resin. I did however get it to work with someone else's
> suggestion... For those who are interested....
> 
> In my Messages.properties file I needed to escape the single qoute in the
> word "Can't"... Notice the 2 single quotes ''
> 
> md.tree.label.feedback1=Can''t find the {0}? Mail
> 
> Then in my JSP I did the following...
> 
> <fmt:message key="md.tree.label.feedback1">
>     <fmt:param><c:out value="${mdTreeForm.map.itemDesc}"/></fmt:param>
> </fmt:message>
> 
> Thanks to those who offered suggestions!
> 
> - Billy -
> 
> 
> On 9/26/03 12:31 PM, "Karr, David" <David.Karr@wamu.net> wrote:
> 
> 
>>You're not using Resin, are you?  Resin has their own JSTL
>>implementation, which might be different from the Jakarta
>>implementation.
>>
>>
>>>-----Original Message-----
>>>From: Billy Bacon [mailto:billy.bacon@thirty3.net]
>>>
>>>I tried this after your suggestion and I still get the same
>>>result. Are you
>>>doing something differently?
>>>
>>><fmt:message key="md.tree.label.feedback1">
>>>    <fmt:param><c:out value="${mdTreeForm.map.itemDesc}"/></fmt:param>
>>></fmt:message>
>>>
>>>On 9/26/03 3:54 AM, "Martin van Dijken" <mvdijken@madocke.nl> wrote:
>>>
>>>
>>>>Hey Billy,
>>>>
>>>>I've got your example working with one little difference,
>>>
>>>though it may not be
>>>
>>>>significant. I've got the value within the param tags
>>>
>>>instead of as value.
>>>
>>>>Grtz,
>>>>
>>>>Martin
>>>>
>>>>
>>>>>-----Original Message-----
>>>>>From: Billy Bacon [mailto:billy.bacon@thirty3.net]
>>>>>
>>>>>I searched the archives and didn't see any issues like this
>>>>>listed. Can
>>>>>anyone help me out here?
>>>>>
>>>>>I original had all struts tags and in my messages.properties
>>>>>file where all
>>>>>my localized content is stored I had the following entry...
>>>>>
>>>>>md.tree.label.feedback1=Can't find the {0}? Mail
>>>>>
>>>>>Notice the {0} which is a place holder for an argument/parameter...
>>>>>
>>>>>This was working fine with Struts but the following is not
>>>>>working in JSTL..
>>>>>
>>>>><fmt:message key="md.tree.label.feedback1">
>>>>>    <fmt:param value="xyz"/>
>>>>></fmt:message>
>>>>>
>>>>>For some reason it's printing out "Can't find the {0}?
>>>
>>>Mail" and not
>>>
>>>>>replacing {0} with 'xyz'...
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: taglibs-user-help@jakarta.apache.org
>>
>>
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: taglibs-user-help@jakarta.apache.org
> 
> 



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

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic