这是我config文件的配置, 手动配置一个userForm类<form-beans > <form-bean name="userForm" type="org.apache.strusts.action.DynaActionForm"> <!-- 该表单的属性是手工配置的 --> <form-property name="username" type="java.lang.String"/> <form-property name="password" type="java.lang.String"/> <form-property name="email" type="java.lang.String"/> </form-bean> </form-beans> <action-mappings > <action attribute="userForm" input="/WEB-INF/register.jsp" name="userForm" parameter="flag" path="/register" scope="request" type="com.yourcompany.struts.action.RegisterAction" cancellable="true" > <forward name="success" path="/WEB-INF/denglu.jsp" /> </action> </action-mappings>在action的register函数里面执行却报空指针异常public ActionForward register(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) { //DynaActionForm userForm = (DynaActionForm) form;// TODO Auto-generated method stub System.out.println("=========="); return mapping.findForward("success"); }求大神解答
添加回答
举报
0/150
提交
取消