普通类Action
调用方便,可融合性高
public class PojoAction {
public String execute() throws Exception{
return “success”;
}
}
继承Action类Action
返回宏 进行方法覆盖,相对于第一种更加不容易出错
public class ActionAction implements Action {
@Override
public String execute() throws Exception {
return SUCCESS;
}
}
最推荐第三种
继承ActionSupport,提供验证方法
最标准
public class ActionSuportAction extends ActionSupport {
@Override
public void validate() {
super.validate();
}
@Override
public String execute() throws Exception {
return super.execute();
}
}