Struts2 does not validate the data through the configuration file. The struts2 configuration file
Common network collection solutions: 1. First, pay attention to the validation. xml name, be sure to take the Action class name plus "-validation. xml" as the file name, such as LoginAction-validation.xml. If you only validate a method in LoginAction, you need to add a method name, such as LoginAction-update-validation.xml 2. the LoginAction-validation.xml file must be in the same directory as the Action Class 3. validation. the type property of the <field-validator type = ""> tag in the xml file, refer to xwork-XX.jar --> com. opensymphony. xwork2.validator. validators --> default. xml 4. in struts. the <action> label in the xml file must contain ''' <result name = "input"> and <result name = "success"> ''', otherwise, an error indicating that the result cannot be found will be reported. After the validation. xml fails, the system will return the page where the input is located by default. This solution (DTD error ):
<! DOCTYPE validators PUBLIC "-// Apache Struts // XWork Validator 1.0.3 //" http://struts.apache.org/dtds/xwork-validator-1.0.3.dtd ">
Change
<! DOCTYPE validators PUBLIC "-// OpenSymphony Group // XWork Validator 1.0.3 //" http://www.opensymphony.com/xwork/xwork-validator-1.0.3.dtd ">