I am using spring's SimpleFormController and html form tags in the view html.
I don't get any data in command object of the onsubmit method of my controller.
If I try to do request.getParameter(anyFormfieldname) I see that the values are there but don't know why the commad object does not have this data ? Am I missing something ?
here's my configuration -
<entry key="/**/MyTest.do">
<ref local="MyController"/>
</entry>
<bean id="MyController" class="com.MyController">
<property name="dataService">
<ref bean="myDataService"/></property>
<property name= "commandClass">
<value>com.myFormBean</value></property>
<property name="commandName" value="myForm"/>
<property name="successView"><value>MyViewInfo</value></property>
</bean>
Here's the view --
<form id="myForm" name="myForm" action="MyTest.do" method="post">
FirstName :<input type="text" name="myForm.firstName" value="AAA"/>
LastName :<input type="text" name="myForm.lastName" value="BBB"/>
<input type="submit" name="myForm.submitButton" id="myForm.submitButton" value="submit" />
</form>
my controller overrides the onSubmit method -
public class TestController extends SimpleFormController {
protected ModelAndView onSubmit(HttpServletRequest request,
HttpServletResponse response,
Object commandObject, BindException exception) {
..
}
}
Thanks.


Reply With Quote