You will need to add the Action mapping in your struts-config.xml file.
You
will also need the form-bean mapping that your form will use to pass the
form data to the action class.
Here is an example.
<form-beans>
<!-- Loin form bean -->
<form-bean name="loginForm"
type="com.dextera.examples.forms.LoginForm"/>
</form-beans>
<action-mappings>
<!-- Process a user login -->
<action path="/login"
type="com.dextera.examples.actions.LoginAction"
name="loginForm"
scope="request"
input="/login.jsp">
<forward name="success" path="/home.jsp"/>
</action-mappings>
All in all you will need the following:
1. A form bean to carry the data
2. Action servlet to perform your action
3. Form bean declaration in struts-config
4. Action mapping in struts-config
if you modify the struts-config.xml,restart tomcat5
Good luck.
Cannot retrieve mapping for action
Struts配置详解
最新推荐文章于 2019-04-18 10:20:16 发布
本文介绍了如何在Struts框架中配置form-bean及action-mapping,包括具体的XML配置示例。通过这些配置,可以实现表单数据传递及业务逻辑处理。
763

被折叠的 条评论
为什么被折叠?



