急,struts中我写的一个actionBean为什么报错?

bitiwang 2004-05-05 01:13:46
代码如下:
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

请问这是怎么回事?
...全文
43 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
shsunv 2004-05-06
  • 打赏
  • 举报
回复
同意 VVV_lucky(*太阳*)
Honeymaster 2004-05-05
  • 打赏
  • 举报
回复
up
zengzz 2004-05-05
  • 打赏
  • 举报
回复
同意楼上的
VVV_lucky 2004-05-05
  • 打赏
  • 举报
回复
public String execute( ActionForm form,
HttpServletRequest request, HttpServletResponse response,
ActionMapping mapping )
throws Exception{

改成
public ActionForward execute( ActionForm form,
HttpServletRequest request, HttpServletResponse response,
ActionMapping mapping )
throws Exception{

81,092

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧