首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > Java Exception >

struts ActionErrors执行不了,是为什么?

2014-01-26 
我在Websphere WSAD5.1 下面能执行,可到移植到Websphere server5.1上就执行不了。我觉得可能是Websphere 5.1

我在Websphere WSAD5.1 下面能执行,
  可到移植到Websphere server5.1上就执行不了。
  我觉得可能是Websphere 5.1还支持不了Struts 1.3不知道是不是,大家帮我看看吧。
 
 
  package itemcontrol.action;
 
 
  import java.io.IOException;
  import javax.servlet.ServletException;
  import org.apache.struts.actions.DispatchAction;
  import javax.servlet.http.HttpServletRequest;
  import javax.servlet.http.HttpSession;
  import javax.servlet.http.HttpServletResponse;
  import org.apache.struts.action.Action;
  import org.apache.struts.action.ActionError;
  import org.apache.struts.action.ActionErrors;
  import org.apache.struts.action.ActionForm;
  import org.apache.struts.action.ActionForward;
  import org.apache.struts.action.ActionMapping;
  import org.apache.struts.action.ActionServlet;
  import itemcontrol.entity.LogonForm;
 
  /**
  * @author box
  */
  public class Logon extends Action {
 
  public ActionForward execute(ActionMapping mapping,
  ActionForm form,
  HttpServletRequest request,
  HttpServletResponse response)
  throws IOException, ServletException {
  ActionErrors errors = new ActionErrors();
  HttpSession session = request.getSession();
 
  LogonForm lof=(LogonForm)form;
  String username=lof.getUsername();
  String password=lof.getPassword();
  if (username==null||username.trim().equals("")||password==null||password.trim().equals(""))
  {
  ActionError error=new ActionError("Logon.notEmpNo");
  errors.add(ActionErrors.GLOBAL_ERROR,error);
  saveErrors(request,errors);
  return mapping.findForward("error");
  }
 
    。。。。。。。。
 
      return mapping.findForward("success");
  }
  }
 
 
  出现下面的错误:
 
  [04-11-2 11:52:33:172 CST] 3df3a7d6 WebGroup E SRVE0026E: [Servlet 错误]-[org.apache.struts.action.ActionMessages: method add(Ljava/lang/String&#59;Lorg/apache/struts/action/ActionMessage&#59;)V not found]:java.lang.NoSuchMethodError: org.apache.struts.action.ActionMessages: method add(Ljava/lang/String;Lorg/apache/struts/action/ActionMessage;)V not found
  at org.apache.struts.action.ActionErrors.add(ActionErrors.java:128)
  at itemcontrol.action.Logon.execute(Logon.java:63)
  at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
  at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
  at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
  at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
  at com.ibm.ws.webcontainer.servlet.StrictServletInstance.doService(StrictServletInstance.java:110)         

热点排行