Struts2 验证框架
Struts 2写校验器时,其校验规则文件定义如:
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE validators PUBLIC?? ?"-//OpenSymphony Group//XWork Validator 1.0.2//EN"?? "http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">
编译器给出了一个warning:Server returned HTTP response code: 403 for URL: http://opensymphony.com/xwork/xwork-validator-1.0.2.dtd
究其原因,我打开http://opensymphony.com/xwork/xwork-validator-1.0.2.dtd后,发现project已经迁走,xwork的移到struts2中,成为apache的一部分,所有的dtd已经移交到http://struts.apache.org/dtds/ 这个地方.
所以以后struts2的校验器的规范要改成:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE validators PUBLIC?
"-//Apache Struts//XWork Validator 1.0.2//EN"?
"http://struts.apache.org/dtds/xwork-validator-1.0.2.dtd">