<action
attribute="studentForm"
input="/student/addStudent.jsp"
name="studentForm"
parameter="add"
path="/addStudent"
scope="request"
type="com.netstars.struts.action.StudentAction">
<forward
name="success"
path="/student/listStudent.jsp"
redirect="true" />
</action>
<action
attribute="studentForm"
input="/student/listStudent.jsp"
name="studentForm"
parameter="delete"
path="/deleteStudent"
scope="request"
type="com.netstars.struts.action.StudentAction">
<forward
name="success"
path="/student/listStudent.jsp"
redirect="true" />
</action>
添加和删除操作采用同一个Action和Form,在Action程序中取parameter属性来区别要进行的操作,String myaction = mapping.getParameter();
attribute="studentForm"
input="/student/addStudent.jsp"
name="studentForm"
parameter="add"
path="/addStudent"
scope="request"
type="com.netstars.struts.action.StudentAction">
<forward
name="success"
path="/student/listStudent.jsp"
redirect="true" />
</action>
<action
attribute="studentForm"
input="/student/listStudent.jsp"
name="studentForm"
parameter="delete"
path="/deleteStudent"
scope="request"
type="com.netstars.struts.action.StudentAction">
<forward
name="success"
path="/student/listStudent.jsp"
redirect="true" />
</action>
添加和删除操作采用同一个Action和Form,在Action程序中取parameter属性来区别要进行的操作,String myaction = mapping.getParameter();
attribute是干什么用的?小弟初学,没看过这个东西。这两个action配置,对应的<form-bean></form-bean>是同一个吗?
一个Form 也可以被多个Action 用
那就是一个Action对应多个ActionForm
一个actionform可以对应多个action