Results 1 to 2 of 2

Thread: ResourceBundleMessageSource multi properties file, same key

  1. #1
    Join Date
    Jan 2007
    Posts
    1

    Default ResourceBundleMessageSource multi properties file, same key

    Hi all,
    i'm using ResourceBundleMessageSource to load all my properties file, using :
    <property name="basenames">
    <list>
    <value>aFileProp</value>
    <value>bFileProp</value>
    </list>
    </property>

    - in my aFileProp.properties i got :
    name_display_flag=true
    - and in my bFileProp.properties i also got :
    name_display_flag=false

    can i determine in my jsp page which resources file i want to use ?
    for example in my a.jsp i want to use aFileProp.properties, not bFileProp.properties.
    FYI : in my jsp file i use :
    <spring:message code="name_display_flag" var="checkValue"/>
    <c:if test="${checkValue == true}">
    </c:if>

    Thank you.

  2. #2
    Join Date
    Apr 2006
    Location
    Canada
    Posts
    164

    Default

    A single ResourceBundleMessageSource cannot support duplicate keys - they get merged at load time, with the last one winning. In theory, you could bejigger things such that you had multiple message sources and a filter to switch between them etc - but wouldn't it be simpler to disambiguate the keys?
    Chris Lee (blog)
    Principal Consultant
    Digital Ascent Inc.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •