只用struts框架,登陆时总是出现Servlet action is not available,路径没问题,什么原因啊?
是缺包吗?

解决方案 »

  1.   

    action没问题
    public class LoginAction extends Action {

    public ActionForward execute(ActionMapping mapping,ActionForm form,
    HttpServletRequest request,HttpServletResponse response){
    LoginForm login = (LoginForm)form;
    String username=login.getUsername();
    String password=login.getPassword();
    if("java".equals(username)&&"123".equals(password)){
    request.getSession().setAttribute("username", username);
    return mapping.findForward("ok");
    }else{
    request.setAttribute("errormsg", "登陆错误");
    return mapping.findForward("error");
    }

    }}
      

  2.   

    404? 路径的问题 就是你那个Action找不到  多检查下