Validation exception in struts2 action
问题 I have some Action class and try to add a form with validation. But every time when I tried to do it I have got an exception. Action class code: public void validate() { if (name == null || name.trim().equals("")) { addFieldError("name", "The name is required"); } if (surname == null || surname.trim().equals("")) { addFieldError("surname", "Age must be in between 28 and 65"); } } Form code: <s:form action="addnew" method="POST"> <s:textfield label="Name: " name="name"/> <s:textfield label=