今天测试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>标记的原因,遂此记。

相关文章:

  • 2022-12-23
  • 2021-09-29
  • 2021-09-24
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-26
  • 2022-12-23
猜你喜欢
  • 2021-10-26
  • 2022-12-23
  • 2021-05-24
  • 2021-06-22
  • 2021-12-24
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案