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

validate 验证出错!!
错误提示信息:
type   Status   report

message   No   input   attribute   for   mapping   path   /login

description   The   server   encountered   an   internal   error   (No   input   attribute   for   mapping   path   /login)   that   prevented   it   from   fulfilling   this   request.


下面是我的jsp代码,
    <body>
        <html:form   action= "/login "   method= "post "   focus= "login "             onsubmit= "return   validateUSserBean(this); ">
            <table   border= "0 ">
                <tr>
                    <td> Username: </td>
                    <td> <html:text   property= "username "   /> </td>
                </tr>
                <tr>
                    <td> Password: </td>
                    <td> <html:password   property= "password "   /> </td>
                </tr>
                <tr>
                    <td   colspan= "2 "   align= "center "> <html:submit   /> </td>
                </tr>
            </table>
        </html:form>
        <html:javascript   formName= "userBean "/>
    </body>


validation.xml的代码
<formset>
<form   name= "userBean ">
<field   property= "username "   depends= "required ">
<msg   key= "errors.required "   name= " "/>
<arg0   key= "userBean.username "   > </arg0>
</field>
</form>
</formset>


我想验证   输入的用户名不为空,第一次用validate不知道哪儿配错了,谁有完整的配置过程,把几个关键点贴出来我看看啊,先谢了
补充一个问题:没有通过验证还进入了action吗?

------解决方案--------------------
你的struts-config配置文件中 没有找到input= "/login "
------解决方案--------------------
那就再加个空的判断条件

if(userBean.getUsername()=null)
------解决方案--------------------
<html:form action= "/login " method= "post " focus= "login " onsubmit= "return validateUSserBean(this); ">
改写为 <html:form action= "/login.do " method= "post " focus= "login " onsubmit= "return validateUSserBean(this); ">
我的异常网推荐解决方案:The server encountered an internal error () that prevented it from fulfilling this request.,http://www.myexce