Back Forum Reply New

Spring Struts integration

Hi

i am working on a project where i integrate struts with spring. using struts tags i am displaying i18n messages for which i kept my resources properties file int /WEB-INF/classes folder. When I wanted to access some of the keys from the property file into a combo box in Struts form, i am creating a bean as shown below
------------------------------------------------------
lt;bean id=quot;messageResourcequot; class=quot;org..beans.factory.config.Pr  opertyPlaceholderConfigurerquot;gt;   lt;property name=quot;locationquot;gt;lt;ref bean=quot;filebeanquot;/gt;lt;/propertygt;   lt;/beangt;   lt;bean id=quot;filebeanquot; class=quot;org..core.io.ClassPathResour  cequot;gt;   lt;constructor-arg index=quot;0quot;gt;lt;valuegt;MyAppResources.propertieslt;/valuegt;lt;/constructor-arggt;   lt;/beangt;
------------------------------------------------------

the above is working fine for the default locale.

now, i wanted to use the above with I18N. how can i get the reference to the resource properties file being used by Struts throug Spring.

plz help me

Hi viewers,
the above problem is solved through using ResourceBundleMessageSource

lt;bean id=quot;messageSourcequot; class=quot;org..context.support.Resourc  eBundleMessageSourcequot;gt;   lt;property name=quot;basenamequot;gt;lt;valuegt;MyAppResourceslt;/valuegt;lt;/propertygt;   lt;/beangt;

Thank you all
¥
Back Forum Reply New