日期:2014-05-18  浏览次数:20576 次

struts validation的一个基本问题
页面a.jsp上有一个link:
<html:link   action= "/a.do "> <bean:message   key= "maintain "/> </html:link>

struts-config里面配置

        <action   path= "/a "   name= "bForm "   type= "test.web.action.aAction "   scope= "request "   validate= "true "   input= "/b.jsp ">
            <forward   name= "show "   path= "/b.jsp "/>
        </action>

在点击a.jsp里面这个连接的时候由于配置了validate= "true ",于是根据validation.xml对bForm进行验证:

                <form   name= "bForm ">
                        <field   property= "Name "   depends= "required ">
                              <arg   key= "name "/>
                        </field>
                </form>

可是由于首次转向b.jsp,b.jsp里面的bFrom中的数据必然为空,所以每次一定会报错,请问有什么好的解决方法?

------解决方案--------------------
有人知道吗?