users@javaserverfaces.java.net

Re: Problem with Message Bundle

From: Alexander Hartner <alex_at_j2anywhere.com>
Date: Fri, 09 Mar 2012 02:21:38 +0800

Hi Roger,

I am not convinced this is a bug. I suspect I must be doing something
silly. If it turns out to be a bug I will raise a JIRA.

Alex

On 03/09/12 02:19, Roger Kitain wrote:
> Please file an issue in the JAVASERVERFACES JIRA project with a test
> case.
>
> -roger
>
> On 3/8/12 1:02 PM, alex_at_j2anywhere.com wrote:
>> In my application I am trying to get labels out of a message bundle.
>> However rather then use constant key values I am using variables
>>
>> <c:forEach var="emailAddress" items="${emailAddresses}">
>> ...
>> <c:set var="labelKey" value="Contact_Label_${emailAddress.type}"/>
>> ...
>> <h:outputText value="#{faces_translations[labelKey]}"/>
>> ...
>> </c:forEach>
>>
>> Most of the time this works correctly, but every so often when a page
>> is loaded some of the label are not processed correctly and the
>> following message is displayed:
>>
>> ???Contact_Label_???
>>
>> It looks like the email.type does not return a value, however I added
>> some debug code to print out the value of email.type by including
>> ${emailAddress.type} and saw that a value was returned.
>>
>> Another thing I tried was to remove the value everytime before setting
>> it again inside the loop using<c:remove.../>. This resulted in the
>> following exception. I verified that I had the tag library included in
>> the WAR file. (jstl-api-1.2.jar and jstl-impl-1.2.jar as well as
>> javax.faces-2.1.7).
>>
>> <c:remove> Tag Library supports namespace:
>> http://java.sun.com/jsp/jstl/core, but no tag was defined for name:
>> remove
>>
>> Both these issues are really baffling. The label works most of the
>> time, but not consistently. The tag is defined in the included library,
>> but cannot be found.
>>
>> Thanks in advance for any pointers.
>> Alex
>
>