From: Keith D. <kd...@cs...> - 2004-06-06 22:06:03
|
Andrew, Your message source bean definition looks fine to me, pulling messages from the root of your classpath, which I assume to be the /src directory. Plus, if there was a problem initializing the message source locations, it would certainly tell you. Do you have an application object configurer bean defined in your context? See the petclinic application-context.xml example. What this does is configure all application objects by bean name after they are instantiated by spring. It is a bean post processor. This is used to wire up internationalized display properties for making those objects fit for display in the GUI. So for example, when the "applicationInfo" bean is instantiated, the configurer will lookup the title, caption, and description from the message source (applicationInfo.title, applicationInfo.caption, applicationInfo.description, respectively) and inject them into your ApplicationInfo bean. Without the configurer defined, none of this will happen. The configurer is there to remove a good deal of the configuration you must specify in the context file. You don't have to use it, but I recommend it. If you don't, you must fully define all required properties in the context file. Keith _____ From: spr...@li... [mailto:spr...@li...] On Behalf Of Andrew Todd Sent: Sunday, June 06, 2004 5:10 PM To: Spring Framework Rich Client Platform Subject: [Springframework-rcp-dev] Dumb Question Obviously this will be a dumb question, but I can't get the message.properties file to be read, which causes the application NOT to load - error about label required. Now, I have my messages.properties file in the src directory My application-context.xml has: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd"> <beans> <bean id="application" class="org.springframework.rcp.application.Application"> <constructor-arg index="0"> <ref bean="applicationInfo"/> </constructor-arg> </bean> <bean id="applicationInfo" class="org.springframework.rcp.application.ApplicationInfo"> <property name="version"><value>1.0</value></property> <property name="buildId"><value>20040530001</value></property> </bean> <bean id="messageSource" class="org.springframework.context.support.ResourceBundleMessageSource"> <property name="basenames"> <list> <value>messages</value> </list> </property> </bean> </beans> My messages.properties file has: applicationInfo.title=Test Application applicationInfo.caption=Test Application Caption, Spring RCP applicationInfo.description=Test Spring RCP And what happens is that the two properties in the application exist fine, but the properties from messages.properties does not - obviously a problem with the messageSource section of the application-context, but what? My directory structure is: /src /src/messages.properties /src/org/at/Start.java /resources/application-context.xml Andrew |