关于struts中的表单元素- Form bean not specified on mapping for action: "helloa.do"报错

今天测试struts时仿照书上写了一个小的表单提交代码

1 <html:form action="helloa.do" method="post">
2         <html:submit value="提交"></html:submit>
3     </html:form>

 Form bean not specified on mapping for action: "helloa.do"错。

struts-config.xml中的配置如下:

<action-mappings>
        <action path="/helloa"
                type="action.HelloAction"
                scope="request"
                input="success.jsp">
            <forward name="s" path="/success.html"/>
        </action>
    </action-mappings>

这里没有用到ActionForm,所以没有加name属性,这个应该没有什么影响。

后来更改前台代码如下:

 <form action="helloa.do" method="post">
        <html:submit value="提交"></html:submit>
    </form>

 

 页面成功跳转,可能是<html:form>标记的原因,遂此记。

posted @ 2015-05-12 22:16  权杖攻城狮  阅读(640)  评论(0编辑  收藏  举报