struts2-jsr303-plugin

How to trigger validation with @Valid annotation in struts2?

怎甘沉沦 提交于 2019-12-10 12:27:52
问题 I cannot make @javax.validation.Valid annotation work in hibernate,struts2 webapp. Here is my simple Entity with constraints: import org.hibernate.validator.constraints.Length; import org.hibernate.validator.constraints.NotEmpty; @Entity @Table(name = "user") public class User implements Serializable { @Id @GeneratedValue @Column(name = "user_id") private Long id; @NotEmpty @Length(max = 50, min = 3, message = "Name should be not less 3 and not more 50") @Column(name = "name", nullable =