struts2如何访问action的特定方法
来源:互联网 发布:网络信息平台建设方案 编辑:程序博客网 时间:2024/05/20 16:45
在使用struts2的时候,我们一般会在一个action中处理很多事情,那么不指定方法就会访问action的默认方法execute,如果指定了则会访问指定的方法。
例如:
http://localhost/struts2/simple/hello.action
默认调用hello这个action中的execute方法!
访问指定方法
方式一:
http://localhost/struts2/simple/hello!say.action
可以调用hello这个action中的say方法
方式二:
http://localhost/struts2/simple/hello.action?method:say=xxx
可以调用say方法,在这里,参数的名称是:method:say,这是最主要的,struts2正是
根据参数的名称来决定该调用哪个方法,而不是参数的值,所以参数的值可以是任意的
方式三:
struts2的配置文件的action标签中存在一个method属性,用来指定访问特定的方法
<action name="hello" class="helloAction" method="say">
方式四:
<action name="hello_*" class="helloAction" method="{1}">
这样在页面中的action路径可写为hello_say.action就是访问say方法了。
- struts2如何访问action的特定方法
- Struts2—Action方法的访问
- ajax能访问struts action中特定的某个方法
- struts2的多线程访问问题(特定参数下只能串行访问action)
- Struts2如何调用Action的方法
- Struts2的Action中方法的几种访问方式
- Struts2中Action访问Servlet API的两种方法
- Struts2中Action访问Servlet API的两种方法
- Struts2中Action访问Servlet API的三种方法
- Struts2中Action访问Servlet API的三种方法
- Struts2中Action访问Servlet API的两种方法
- Struts2中Action访问Servlet API的三种方法
- Struts2:解决不能访问action里面的方法
- Struts2中Action访问Servlet API的三种方法
- Struts2中Action访问Servlet API的三种方法
- struts2一个action返回到另一个action的特定result
- Struts2 Action的访问路径
- Struts2 Action的访问路径
- listView图片错乱
- Nginx 日志分析
- java设计模式---单例模式
- poj3894 System Engineer 二分图匹配(匈牙利算法的DFS实现)
- WPF中查找子控件、父控件的方法
- struts2如何访问action的特定方法
- 开源的物理引擎
- java POJO实现类比较器Comparable的排序规则
- 纪律:让“爱”变得愈发有力
- 自适应移动设备页面前端注意的问题
- 如何彻底卸载oracle
- Hibernate从入门到精通(六)一对一双向关联映射 .
- solr配置文件详解
- ubuntu上网慢的问题