急,struts中我写的一个actionBean为什么报错?
代码如下:
package com.laya.oproj.tp.wl.client;
import org.apache.struts.action.*;
import javax.servlet.http.*;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionForward;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import javax.servlet.http.HttpServletResponse;
public class ClientUserCheckAction extends Action
{
public String execute( ActionForm form,
HttpServletRequest request, HttpServletResponse response,
ActionMapping mapping )
throws Exception{
ActionErrors errors = new ActionErrors();
ClientUserCheckForm clientusercheckform = (ClientUserCheckForm)form;
String username = clientusercheckform.getUsername();
String password1 = clientusercheckform.getPassword1();
String password2 = clientusercheckform.getPassword2();
if(username.equals("wang")==false){
errors.add("USERNAME", new ActionError("cuowu"));
saveErrors(request,errors);
return (mapping.getInputForward());
}
return (mapping.findForward("success"));
}
}
编译报错:
found : org.apache.struts.action.ActionForward
required: java.lang.String
return (mapping.getInputForward());
^
found : org.apache.struts.action.ActionForward
required: java.lang.String
return (mapping.findForward("success"));
^
2 errors
请问这是怎么回事?
package com.laya.oproj.tp.wl.client;
import org.apache.struts.action.*;
import javax.servlet.http.*;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionForward;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import javax.servlet.http.HttpServletResponse;
public class ClientUserCheckAction extends Action
{
public String execute( ActionForm form,
HttpServletRequest request, HttpServletResponse response,
ActionMapping mapping )
throws Exception{
ActionErrors errors = new ActionErrors();
ClientUserCheckForm clientusercheckform = (ClientUserCheckForm)form;
String username = clientusercheckform.getUsername();
String password1 = clientusercheckform.getPassword1();
String password2 = clientusercheckform.getPassword2();
if(username.equals("wang")==false){
errors.add("USERNAME", new ActionError("cuowu"));
saveErrors(request,errors);
return (mapping.getInputForward());
}
return (mapping.findForward("success"));
}
}
编译报错:
found : org.apache.struts.action.ActionForward
required: java.lang.String
return (mapping.getInputForward());
^
found : org.apache.struts.action.ActionForward
required: java.lang.String
return (mapping.findForward("success"));
^
2 errors
请问这是怎么回事?
...全文
相关推荐
java试题(Hibernate,j2ee )
Hibernate,j2ee,Struts,Spring方面的试题
struts2文件下载点击取消服务器报错解决办法
通过覆写StreamResult的方法 解决struts2文件下载点击取消服务器报错解
解决Struts2中下载文件时点击取消按钮后台报错问题
解决Struts2中下载文件时,点击弹出框上面的取消按钮后,后台报错问题
struts2-json包集合 不会出现任何报错
解决Struct相关包与json相关包不匹配的几个包 导入既可使用json,不会出现textutils class找不到的情况,包治包好
struts2 依赖注入boolean类型的属性时报错
NULL 博文链接:https://hw1287789687.iteye.com/blog/1949399


Web 开发
