Announcement Announcement Module
Collapse
No announcement yet.
put message.properties in a directory outside the project location Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • put message.properties in a directory outside the project location

    Hi,

    Is it possible to use messageSource configuration with a property file located in a separated folder - in any place in the disc?

    HTML Code:
    <bean id="messageSource" class="org.springframework.context.support.ReloadableResourceBundleMessageSource">
    		<property name="basenames">
    			<list>
    				<value>WEB-INF/classes/messages</value>
    				<value>classpath:mailmessages</value>
    				<value>classpath:exceptionmessages</value>
    				<value>[COLOR="Red"]classpath:c:\\adam\\lang\\common\\eng.properties[/COLOR]</value>
    			</list>
    		</property>
    		<property name="fileEncodings" value="UTF-8" />
    	    <property name="defaultEncoding" value="UTF-8" />
    	</bean>
    If so - will it require to rebuild the project's war file whenever i change eng.properties content or change the file to a different file?

    Thanks a lot.

  • #2
    Regardin the first problem - i managed to read a message from an external directory after adding it to the tomcat run time .classpath & edting the configuration as follows:

    HTML Code:
    	<bean id="messageSource" class="org.springframework.context.support.ReloadableResourceBundleMessageSource">
    		<property name="basenames">
    			<list>
    				<value>WEB-INF/classes/messages</value>
    				<value>classpath:mailmessages</value>
    				<value>classpath:exceptionmessages</value>
    				<value>classpath:eng1</value>
    			</list>
    		</property>
    		<property name="fileEncodings" value="UTF-8" />
    	    <property name="defaultEncoding" value="UTF-8" />
    	</bean>
    regarding the second issue: whenever i change the property file content i'll need to restart the server.

    Can i set the 'basenames' property in runtime?

    Thanks.

    Comment

    Working...
    X