java - Cannot resolve property `paramName` in Spring MVC -
i need set spring mvc interseptors catch url parameter language , accordingly data .properties file. getting error cannot resolve propertyparamname when configuring context in servlet-config.xml:
<?xml version="1.0" encoding="utf-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns:context="http://www.springframework.org/schema/context" xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:p="http://www.springframework.org/schema/p" xsi:schemalocation="http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.2.xsd http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.2.xsd"> <mvc:annotation-driven/> <mvc:resources mapping="/pdfs" location="pdfs"/> <context:component-scan base-package="com.ttu.cs.controller"/> <bean id="messagesource" class="org.springframework.context.support.resourcebundlemessagesource" p:basename="messages" /> <bean class="org.springframework.web.servlet.view.internalresourceviewresolver" p:prefix="/web-inf/jsp/" p:suffix=".jsp" /> <bean id="localeresolver" class="org.springframework.web.servlet.i18n.sessionlocaleresolver" p:defaultlocale="en"/> <!-- declare interceptor --> <mvc:interceptors> <bean class="org.springframework.web.servlet.i18n.sessionlocaleresolver"> <property name="paramname" value="language"/> </bean> </mvc:interceptors> </beans>
i think meant use org.springframework.web.servlet.i18n.localechangeinterceptor rather sessionlocaleresolver.
<bean class="org.springframework.web.servlet.i18n.localechangeinterceptor"> <property name="paramname" value="language"/> </bean> this class handlerinterceptor , have paramname property.
sessionlocaleresolver, on other hand, not.
Comments
Post a Comment