Thank you very much for response, however the problem still persist after I upgraded hibernate to version 3.5.4
This how my controller looks
@Controller @RequestMapping("/form.htm") public class FormTestController {
@RequestMapping(method = RequestMethod.GET) public String get(final ModelMap model) {
UserForm userForm = new UserForm(); model.addAttribute("userForm", userForm); return "form"; }
@RequestMapping(method = RequestMethod.POST) public String post(final ModelMap model, @Valid final UserForm userForm, final BindingResult result) {
if (result.hasErrors()) { return "form"; }
return "success"; } }
My entity class looks like this
public class UserForm {
@NotEmpty @Size(max = 20) private String name; @NotEmpty @Email private String email;
public String getEmail() { return email; }
public void setEmail(String email) { this.email = email; }
public String getName() { return name; }
public void setName(String name) { this.name = name; } }
and libraries in my classpath after I upgraded to hibernate 3.5.4 looks like this
antlr-2.7.6.jar asm-attrs.jar asm.jar cglib-2.1.3.jar cglib-2.2.jar commons-collections-2.1.1.jar commons-collections-3.1.jar commons-logging-1.1.jar dom4j-1.6.1.jar ehcache-1.2.3.jar ejb3-persistence.jar hibernate-annotations.jar hibernate-commons-annotations.jar hibernate-entitymanager.jar hibernate-jpa-2.0-api-1.0.0.Final.jar hibernate-testing.jar hibernate-tools.jar hibernate-validator-4.1.0.Final.jar hibernate3.jar javaee-api-6.0.jar javassist-3.9.0.GA.jar javassist.jar jdbc2_0-stdext.jar jstl.jar jta-1.1.jar jta.jar log4j-1.2.14.jar slf4j-api-1.5.6.jar slf4j-api-1.5.8.jar slf4j-log4j12-1.5.6.jar spring-aop-3.0.2.RELEASE.jar spring-asm-3.0.2.RELEASE.jar spring-aspects-3.0.2.RELEASE.jar spring-beans-3.0.2.RELEASE.jar spring-context-3.0.2.RELEASE.jar spring-context-support-3.0.2.RELEASE.jar spring-core-3.0.2.RELEASE.jar spring-expression-3.0.2.RELEASE.jar spring-instrument-3.0.2.RELEASE.jar spring-instrument-tomcat-3.0.2.RELEASE.ja r spring-jdbc-3.0.2.RELEASE.jar spring-jms-3.0.2.RELEASE.jar spring-orm-3.0.2.RELEASE.jar spring-oxm-3.0.2.RELEASE.jar spring-struts-3.0.2.RELEASE.jar spring-test-3.0.2.RELEASE.jar spring-tx-3.0.2.RELEASE.jar spring-web-3.0.2.RELEASE.jar spring-webmvc-3.0.2.RELEASE.jar spring-webmvc-portlet-3.0.2.RELEASE.jar standard.jar validation-api-1.0.0.GA.jar
I hope I can get the validator to work for my project
|