PDA

View Full Version : Valang Validation in a portlet


GrantGochnauer
Feb 8th, 2006, 12:16 PM
I am currently trying to use the valang validation beans from the spring modules project. I have been having problems when I add the Valang intercptor to my list of interceptors on the portletModeParameterHandlerMapping..

I have it currently defined as:

<bean id="valangMappingInterceptor" class="org.springmodules.validation.javascript.taglib.Val angRulesExportInterceptor"/>

<bean id="portletModeParameterHandlerMapping"
class="org.springframework.web.portlet.handler.PortletMod eParameterHandlerMapping">
<property name="order" value="10"/>
<property name="interceptors">
<list>
<ref bean="parameterMappingInterceptor"/>
<ref bean="valangMappingInterceptor"/>
</list>
</property>
<property name="portletModeParameterMap">
<map>
<entry key="view">
<map>
<entry key="user">
<ref bean="userViewController"/>
</entry>
<entry key="continueRegistration">
<ref bean="gatherUserInformation"/>
</entry>
</map>
</entry>
</map>
</property>
</bean>

and the stack trace I am seeing is:

org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'portletModeParameterHandlerMapping' defined in Portl
etContext resource [/WEB-INF/context/portlet/userRegistration.xml]: Error setting property values; nested exception is org.springframework.b
eans.PropertyAccessExceptionsException: PropertyAccessExceptionsException (1 errors); nested PropertyAccessExceptions are: [org.springframew
ork.beans.TypeMismatchException: Failed to convert property value of type [java.util.ArrayList] to required type [[Lorg.springframework.web.
portlet.HandlerInterceptor;] for property 'interceptors'; nested exception is java.lang.IllegalArgumentException: No matching editors or con
version strategy found]
PropertyAccessExceptionsException (1 errors)
org.springframework.beans.TypeMismatchException: Failed to convert property value of type [java.util.ArrayList] to required type [[Lorg.spri
ngframework.web.portlet.HandlerInterceptor;] for property 'interceptors'; nested exception is java.lang.IllegalArgumentException: No matchin
g editors or conversion strategy found
java.lang.IllegalArgumentException: No matching editors or conversion strategy found
at org.springframework.beans.PropertyTypeConverter.do TypeConversionIfNecessary(PropertyTypeConverter.ja va:156)
at org.springframework.beans.PropertyTypeConverter.do TypeConversionIfNecessary(PropertyTypeConverter.ja va:73)
at org.springframework.beans.PropertyTypeConverter.co nvertToTypedArray(PropertyTypeConverter.java:211)
at org.springframework.beans.PropertyTypeConverter.do TypeConversionIfNecessary(PropertyTypeConverter.ja va:123)
at org.springframework.beans.BeanWrapperImpl.setPrope rtyValue(BeanWrapperImpl.java:723)
at org.springframework.beans.BeanWrapperImpl.setPrope rtyValue(BeanWrapperImpl.java:575)
at org.springframework.beans.BeanWrapperImpl.setPrope rtyValue(BeanWrapperImpl.java:769)
at org.springframework.beans.BeanWrapperImpl.setPrope rtyValues(BeanWrapperImpl.java:796)

Has anyone successfully used Valang validation inside a portlet? Perhaps there is something else I am doing wrong?