struts2 validation. XML validation rule code parsing

When using struts 2 validation When validating XML, you should pay attention to the following aspects:

1. First, you should pay attention to validation The name of XML must take the class name of action plus "- validation. XML" as the file name. Enter loginaction validation xml。

II. LoginAction-validation. The XML file must be placed in the same directory as the action class.

III.validation. The type attribute of the < Field Validator type = "" > tag in the XML file must be the same as the data type of the attribute defined in VO.

4. In struts The < action > tag in the XML file must contain < result name = "input" > and < result name = "success" >, otherwise it will report that the page cannot be found (404).

5. An example validation XML code:

summary

The above is about struts 2 validation XML validation rules code parsing all the contents, I hope to help you. Interested friends can continue to refer to other related topics on this site. If there are deficiencies, please leave a message to point out. Thank you for your support!

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>