本帖最后由 tc45a4 于 2010-03-02 01:31:04 编辑

解决方案 »

  1.   

     public ActionForward execute(ActionMapping mapping, ActionForm form, ServletRequest request, ServletResponse response) throws Exception
    throws Exception 去掉看看。
    底层实现:
    Action action=new RegisterAction();
    action.execute();应该是调用了父类的execute的方法。那样写的话没重载父类的execute方法。因此程序运行的时候调用了父类的方法。
     
      

  2.   

    说错了。底层实现: 
    Action action=new RegisterAction(); 
    action.execute();你那样写应该是调用了父类的execute的空方法。
    因为你写的方法没重写了父类的execute方法。
      

  3.   

    RegisterAction.java import javax.servlet.ServletRequest;
    import javax.servlet.ServletResponse;
    改成
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;我也在学struts,刚刚把你代码拷下来调试了半天,才找到原来你是导错了类。。和throws Exception没关系
      

  4.   

    兄弟,请你以后在导包的时候要注意,
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;这两个包是针对Http协议的。
      

  5.   

    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;public ActionForward execute(ActionMapping mapping, ActionForm form, ServletRequest request, ServletResponse response) throws Exception{应该是HttpServletRequest request, HttpServletResponse response