Struts三种开发action的方式

2017-05-10  本文已影响10人  133sheiya

import com.opensymphony.xwork2.ActionSupport;

/**

*/
public class HelloWorld extends ActionSupport {

@Override
public String execute() throws Exception {
    // TODO Auto-generated method stub
    return SUCCESS;
}

}

import com.opensymphony.xwork2.Action;

/**

*/
public class HelloWorld2 implements Action{
@Override
public String execute() throws Exception {
// TODO Auto-generated method stub
return SUCCESS;
}
}

POJO方式(Plain Ordinary Java Object) 简单的Java类对象
/**

*/
public class HelloWorld3 {
//权限修饰符为 public 为参 String返回值
public String execute() {
return "success";
}
}

上一篇下一篇

猜你喜欢

热点阅读