Announcement Announcement Module
Collapse
No announcement yet.
Import resources based on static field in Spring XML file Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Import resources based on static field in Spring XML file

    I want to know if there is something like this to import resource file inside Spring context XML file.

    The xml file should resolve properties file based on a static field inside a class. Is that possible? The static field changes depending on the argument which tells the main XML file what to import.

    Code:
    	<util:constant id="prog.context" static-field="com.xxx.Launcher.IN"/>
    	<import resource="prog.context" />
    I also tried the following but not working

    Code:
    	<bean id="props" class="org.springframework.beans.factory.config.PropertiesFactoryBean">
            <property name="location">
            	<util:constant static-field="com.XX.Launcher.CONTEXT_NAME"/>
            </property>
    	</bean>
    Last edited by srikanthradix; Mar 16th, 2010, 03:26 PM.
Working...
X