Struct2 三种配置动作类和视图的姿势
#1.`第一种无侵入
package actions;
//1.第一种无侵入
public class MyAction {
public String tell() {
System.out.println("a=====");
return "a";
}
}
#2.实现Action接口
package actions;
import com.opensymphony.xwork2.Action;
//2.实现Action接口
public class TestAction implements Action {
@Override
public String execute() throws Exception {
return "test";
}
}
#3…继承ActionSupport 默认的动作类
package actions;
import com.opensymphony.xwork2.ActionSupport;
//3.继承ActionSupport 默认的动作类
public class TestAction2 extends ActionSupport {
/**
*
*/
private static final long serialVersionUID = 1L;
}