struts2中的action中实现了validate方法,struts.xml中的action配置了通配符,不能自动跳转到input

问题描述:struts2中的action中实现了validate方法,struts.xml中的action配置了通配符,当validate方法执行了this.addFieldError()等方法时,不能自动跳转到action中配置的input的页面,直接跳转到success页面.


struts.xml中的action配置如下:

   <package name="user" namespace="/user" extends="struts-default">
    <action name="*_*" class="com.xz.action.{2}Action" method="{1}">
    <result name="input">/{1}_{2}.jsp</result>
    <result>/{1}_{2}.jsp</result>
    </action>
    </package>


解决办法:

<result name="input">/input_User.jsp</result>,不写通配符,直接写。


                                                        快乐学习,快乐编程!

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章