1.一个普通的类

public class testAction1 {
    public String execute(){
        return "success";
    }
}

2.实现Action接口

public class testAction2 implements Action {

    @Override
    public String execute() throws Exception {
        // TODO Auto-generated method stub
        return SUCCESS;//这个时候可以用SUCCESS,因为Action接口中有SUCCESS
    }

}

3.继承ActionSupport类

public class testAction3 extends ActionSupport {
    
    public String execute() throws Exception{
        return SUCCESS;//ActionSupport接口实现了Action类
    }

}

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-01
  • 2021-09-02
  • 2022-12-23
  • 2021-11-22
  • 2021-11-23
猜你喜欢
  • 2022-12-23
  • 2021-09-28
  • 2021-04-14
  • 2022-12-23
  • 2021-10-25
  • 2021-11-26
  • 2022-12-23
相关资源
相似解决方案