struts2开发action 的三种方法以及通配符、路径匹配原则、常量
2017-12-11 22:41
609 查看
struts2开发action 的三种方法
1、继承ActionSupport
2、实现Action
3、既不继承也不实现任何的方法
动态方法调用
1、继承ActionSupport
public class UserAction extends ActionSupport { // Action中业务处理方法 public String login() { System.out.println("UserAction.login()"); // return "success"; return SUCCESS; } }
2、实现Action
public class UserAction3 implements Action { // Action中业务处理方法 public String login() { System.out.println("UserAction.login()"); return "success"; } @Override public String execute() throws Exception { return null; } }
3、既不继承也不实现任何的方法
public class UserAction { private String userName; public void setUserName(String userName) { this.userName = userName; } // Action中业务处理方法 public String login() { System.out.println("UserAction.login()" + userName); return "login"; } public String register() { System.out.println("register()" + userName); return "register"; } }
动态方法调用
相关文章推荐
- 2、struts2开发action 的三种方法以及通配符、路径匹配原则、常量
- struts2的action方法匹配以及通配符的使用
- struts2的action方法匹配以及通配符的使用
- struts2的action方法匹配以及通配符的使用
- 第29天(就业班) Action开发、通配符、路径匹配、常量、数据处理、日期类型转换、文件上传下载
- Struts2一个Action内包含多个请求处理方法的处理,method的使用方法,struts2中的路径问题,通配符映射
- Struts.xml中Action的method与路径的三种匹配方法
- Struts.xml中Action的method与路径的三种匹配方法
- Struts2一个Action内包含多个请求处理方法的处理,method的使用方法,struts2中的路径问题,通配符映射
- Struts2第三篇【Action开发方式、通配符、Struts常量、跳转全局视图、action节点默认配置】
- Struts2一个Action内包含多个请求处理方法的处理,method的使用方法,struts2中的路径问题,通配符映射 (
- Struts.xml中Action的method与路径的三种匹配方法
- Struts2第三篇【Action开发方式、通配符、Struts常量、跳转全局视图、action节点默认配置】
- Struts.xml中Action的method与路径的三种匹配方法
- Action开发、通配符、路径问题和struts中常量用法
- Struts2一个Action内包含多个请求处理方法的处理,method的使用方法,struts2中的路径问题,通配符映射
- struts2通配符的应用以及action、result、package的name和namespace属性同名时的处理方法
- Struts2一个Action内包含多个请求处理方法的处理,method的使用方法,struts2中的路径问题,通配符映射
- Struts2-Action-4-系列问题(路径、调用Action的自定义方法、通配符)
- struts2中action的路径问题以及在MyEclipse8.5中的说明(通配符等等)