求一个过程:如何Spring 整合struts的委托!我先说大概(这个大概没有跑起来,真累人。我也不知道错在哪里)
1.加载这个不用说了。
<plug-in
className="org.springframework.web.struts.ContextLoaderPlugIn">
<set-property property="contextConfigLocation"
value="/WEB-INF/applicationContext.xml" />
</plug-in>
2.这个要说
<form-bean name="searchForm"
type="org.apache.struts.action.DynaActionForm">
<form-property name="name" type="java.lang.String" />
</form-bean>
<action-mappings>
<action 
path="/student"
name="searchForm"
type="org.springframework.web.struts.DelegatingActionProxy" />
</action-mappings>一个动态form,然后我有一个StudentForm!
现在进入spring配置<bean id="studentBean" class="com.huayiluo.struts.form.StudentForm"></bean>
<bean name="/student" class="com.huayiluo.struts.action.StudentAction">
<property name="studentForm">
<ref bean="studentBean"/>
</property>一个Form类:
public class StudentForm extends DynaValidatorFormAction类:
public class StudentAction extends Action{
private StudentForm studentForm;
public void setStudentForm(StudentForm studentForm) {
this.studentForm = studentForm;
}
public ActionForward execute(ActionMapping arg0, ActionForm arg1, HttpServletRequest arg2, HttpServletResponse arg3) throws Exception {
System.out.println(studentForm.getName());//这里是null不知道什么错,没有装进来
return null;
}
}上面是我做的流程,不知道哪里出错了