hi Folks,
when I'm trying to inject a bean with String Property it is not loading the property correctly. I have the following config ...
My applicationContext.xml has the following ..Code:web.xml : <context-param> <param-name>contextConfigLocation</param-name> <param-value> /WEB-INF/classes/applicationContext.xml </param-value> </context-param> <listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener> . . . . . <servlet> <servlet-name>frontController</servlet-name> <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> <load-on-startup>2</load-on-startup> </servlet> <servlet-mapping> <servlet-name>frontController</servlet-name> <url-pattern>/frontController/*</url-pattern> </servlet-mapping> frontController-servlet.xml : <bean id="search" class="com.web.action.Search"> <property name="serviceUrl"><value>${ServletPath}?${ReportUnit}&format=xls&KEY=</value></property> </bean>
In the Reports.properties I've the following ...Code:applicationContext <beans> <bean name="propertyPlaceholder" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> <property name="locations"> <list> <value>classpath:Reports.properties</value> </list> </property> </bean> </beans>
Into my bean I'm only getting "${ServletPath}?${ReportUnit}&format=xls&KEY=" and not "/NWE/jasper?DetailsExportReport&format=xls&KEY=" which is what I want ...Code:Reports.properties ReportUnit=DetailsExportReport ServletPath=/NWE/jasper
Does anyone know where am I going wrong?


Reply With Quote
. Read chapter 3 about the container.