I am bignner and I am trying to write simple spring example which takes name and surname input from
jsp file and call the controller .
Its initially showing jsp page proper but after click on submit button i am not getting success page, as i dig out the code i come to know its not calling controller properly.
Please let me know where is the problem exactly.
1.<bean id="beanNameUrlMapping" class="org.springframework.web.servlet.handler.BeanNameUrlHandlerMapping">
<property name="order"><value>0</value></property>
</bean>
2.
<bean name="/CreateContact.htm" class="com.CreateContactController">
<property name="formView"><value>CreateContact</value></property>
<property name="successView"> <value>ContactCreated</value> </property>
<property name="commandClass"><value>test.Contact</value></property>
<property name="commandName"><value>MyCommandName</value></property>
<property name="contactService"><ref local="contactService"/></property>
</bean>
4.public class CreateContactController extends SimpleFormController{
private ContactService contactService;
public void setContactService(ContactService contactService) {
this.contactService = contactService;
}
public CreateContactController() {
System.out.println("this is CreateContactController CreateContactController()");
setCommandClass(Contact.class);
}
public ModelAndView onSubmit(Object command) throws ServletException {
System.out.println("done");
Contact contact=(Contact) command;
ContactService.createContact(contact);
return new ModelAndView(new RedirectView(getSuccessView()));
}