Announcement Announcement Module
Collapse
No announcement yet.
Accessing Resource Bundle in ApplicationContext.xml Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Accessing Resource Bundle in ApplicationContext.xml

    Hi,

    I have going through this post

    http://forum.springsource.org/showthread.php?t=73426

    about accessing a resource bundle in an xml file.

    However i want to access language specific resource bundle from the xml file and set the property accordingly.

    Code:
    <bean id="servicePropertyConfig" 
    	class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
    	<property name="locations">
    		<list>
    			<value>classpath:resource.properties</value>
    			<value>classpath:resource_fr.properties</value>
                            <value>classpath:resource_ar.properties</value>
    		</list>
    	</property>
    	<property name="placeholderPrefix" value="$properties{"/>
    </bean>
    
    ....
    
    <bean id="beanWithAProperty"  class="foo.Class">
    	<property name="propertyToSet" value="$properties{property.from.bundle}"/>
    </bean>
    Here i need to access either of resource.properties/resource_ar.properties/resource_fr.properties; depending on the locale selected.

    How ever when i include all the three property files only the properties of last specified resource bundle are being fetched (resource_ar.properties) in this case.

    How do i make the xml file access locale specific resource file dynamically.

    Thanks,

    Abdul Mujeeb.
Working...
X