当前位置: 代码迷 >> Java Web开发 >> structs 校验有异常
  详细解决方案

structs 校验有异常

热度:666   发布时间:2016-04-12 23:18:56.0
structs 校验有错误
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE validators PUBLIC
        "-//OpenSymphony Group//XWork Validator Config 1.0//EN"
        "http://www.opensymphony.com/xwork/xwork-validator-config-1.0.dtd">
<validators>
    <field name="username">
        <field-validator type="requiredstring">
            <param name="trim">true</param>
            <message>username 不能为空</message>
        </field-validator>
    </field>
    <field name="password">
        <field-validator type="requiredstring">
            <param name="trim">true</param>
            <message>password不能为空</message>
        </field-validator>
    </field>
</validators>

为什么在每行代码下边都有黄色的波浪线啊?还有在<validators>标签有提示:The content of element type "validators" must match "(validator)+".

------解决方案--------------------
头部换成
<!DOCTYPE validators PUBLIC 
"-//OpenSymphony Group//XWork Validator 1.0.3//EN"
"http://www.opensymphony.com/xwork/xwork-validator-1.0.3.dtd">