今天测试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怎么学习?HTML怎么入门?HTML在哪学?HTML怎么学才快?不用担心,这里为大家提供了HTML速学教程(入门课程),有需要的小伙伴保存下载就能学习啦!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号