struts2如何动态调用action的方法以及使用json插件范围json格式的javascript对象
2012-03-18 12:37
1256 查看
/********************************************/ //>在struts2中如何动态调用方法和如何使用json插件 /********************************************/ /********************************************/ >0.配置解析 //>设置全局常量用于动态调用方法并且指定action的结尾的扩展名 //<constant name="struts.enable.DynamicMethodInvocation" value="true"></constant> //<constant name="struts.action.extension" value=""></constant> /********************************************/ /********************************************/ >1.json插件配置解析 //如果使用json插件 //<package name="solrIndex" namespace="/solrIndex" extends="json-default"></package> //必须继承jso-default配置栈 //调用某个方法后action会自动将自己的属性的对象转化为json格式的javascript对象返回给浏览器 /********************************************/ /********************************************/ >2.action方法动态调用配置以及使用解析 //<action name="testAction_*" // class="com.eastlinden.action.manager.core.TestAction" // method="{1}"> //必须从1开始 //<result type="json"></result> //</action> //notes:testAction!test.action必须要以.action结尾不然报错 //这是struts2自带的动态调用action方法的一种方式 //http://localhost:8080/testRRC/solrIndex/testAction!test.action //如果按照自己配置的方式去调用的话按照指定action的名字的正则表达式去输入就行了 /********************************************/
相关文章推荐
- 使用<a>标签调用struts2的action、传递动态参数、以及参数中出现加号等特殊字符的处理方法
- Struts2为应用指定多个配置文件和动态方法调用以及通配符的使用方法
- Struts2_动态方法调用和使用通配符定义action
- struts2中动态方法调用和使用通配符定义Action
- struts2中使用DMI(动态调用方法)方式配置action
- struts2中动态方法调用和使用通配符定义Action
- 关于new Function使用以及将json格式字符串转化为json对象方法介绍
- 关于Struts2 使用! 感叹号 动态调用Action中的方法
- 使用Struts2动态方法调用时(DMI)出现There is no Action mapped for namespace [/user] and action name [user!add] 问题
- 第三章Struts2 Action中动态方法调用、通配符的使用
- struts2动态方法调用和使用通配符定义action
- struts2中使用DMI(动态调用方法)方式配置action
- struts2动态方法调用和使用通配符定义action
- struts2教程:10、动态方法调用和使用通配符定义action
- struts2学习笔记--------动态方法调用和使用通配符定义action
- 使用MVC中的HtmlHelper对象的ActionLink方法,实现一个Javascript:void(0)效果,去调用一个JS方法
- Struts2动态方法调用和使用通配符定义action
- struts2-10动态方法调用和使用通配符定义action
- 每当使用struts2动态方法调用时,总是出现错误:There is no Action mapped for namespace [/user] and action name [user!add]
- Struts2 Action中动态方法调用、通配符的使用