myeclipse 8.5中 使用struts框架 用 form 接值报错问题
package action;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import dao.RegisterDao;
import form.RegisterForm;
public class RegisterAction extends Action {
public ActionForward execute(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws Exception {
RegisterForm rf = (RegisterForm) form;
RegisterDao registerDao = new RegisterDao();
if (registerDao.regist(rf)> 0) {
return mapping.findForward("registerok");
} else {
return mapping.findForward("registerfail");
}
}
}
如题 红色 字体的部分为报错的部分,错误描述:红色 字体的部分 下面有波浪线 的错误提示 ,此行的最前端是 大红差号 无法按提示解决
------解决方案--------------------RegisterForm没有继承ActionForm
RegisterForm extends ActionForm
------解决方案--------------------楼上正解