Hello
I am been trying to add a spring validator into my jsf implementation but the following exception is thrown after submit:
After stepping through the code I have found that the validateMethodInvoker is null.Code:17:57:28,953 INFO [HtmlRenderKitImpl] Overwriting renderer with family = javax.faces.Command rendererType = javax.faces.Link renderer class = org.apache.shale.renderer.ValidatorCommandRenderer 17:59:03,468 ERROR [[/websara]] Exception thrown executing [AnnotatedAction@1cf701c targetAction = com.xxxx.eets.app.tag.flow.TagFlowFormActionDelegate@167e563, attributes = map['method' -> 'validate', 'validatorMethod' -> 'validateTagCode']] in state 'enterTagDetails.view' of flow 'tag-main-flow' -- action execution attributes were 'map['method' -> 'validate', 'validatorMethod' -> 'validateTagCode']'; nested exception is java.lang.NullPointerException org.springframework.webflow.engine.ActionExecutionException: Exception thrown executing [AnnotatedAction@1cf701c targetAction = com.xxxx.eets.app.tag.flow.TagFlowFormActionDelegate@167e563, attributes = map['method' -> 'validate', 'validatorMethod' -> 'validateTagCode']] in state 'enterTagDetails.view' of flow 'tag-main-flow' -- action execution attributes were 'map['method' -> 'validate', 'validatorMethod' -> 'validateTagCode']'; nested exception is java.lang.NullPointerException Caused by: java.lang.NullPointerException at org.springframework.webflow.action.FormAction.invokeValidatorMethod(FormAction.java:805) at org.springframework.webflow.action.FormAction.doValidate(FormAction.java:932) at org.springframework.webflow.action.FormAction.validate(FormAction.java:640)
I have run the sellitem-jsf example successfully so there's obviously something odd in how I am configuring this.Code:/** * Returns a dispatcher to invoke validation methods. Subclasses could * override this to return a custom dispatcher. */ protected DispatchMethodInvoker getValidateMethodInvoker() { return validateMethodInvoker; }
Code:<bean name="tagViewController" class="com.xxx.eets.app.tag.flow.TagFlowViewController" scope="prototype"/> <bean id="tagFormAction" class="com.xxx.eets.app.tag.flow.TagFlowFormActionDelegate"> <property name="formObjectName" value="tagViewController" /> <property name="formObjectClass" value="com.xxx.eets.app.tag.flow.TagFlowViewController" /> <property name="formObjectScope" value="FLOW" /> <property name="validator"> <bean class="com.xxx.eets.app.tag.validator.TagMainValidator" /> </property> <property name="userService" ref="userServiceTxnl"/> <property name="searchUserFlowHandler" ref="searchUserFlowHandler"/> <property name="searchAccountFlowHandler" ref="searchAccountFlowHandler"/> <property name="saveTagFlowHandler" ref="saveTagFlowHandler"/> </bean>Any advice would be appreciated.Code:<transition on="submit" to="manageUsers.view"> <action bean="tagFormAction" method="validate"> <attribute name="validatorMethod" value="validateTagCode" /> </action> </transition>
regards JC.


Reply With Quote