struts2使用OGNL表达式访问方法与属性
2018-02-28 15:04
477 查看
//访问静态变量 PI:<s:property value="@java.lang.Math@PI"/> <br> //访问静态方法 COS:<s:property value="@java.lang.Math@cos(1)"/> //访问对象方法 <s:property value="setProperties('value')"/> <% String[] arg = new String[]{"aa","bb","cc","dd"}; request.setAttribute("arg",arg); %> <br> arg.length:<s:property value="#attr.arg.length"/> <br> arg.[1]:<s:property value="#attr.arg[1]"/>
相关文章推荐
- Struts2中使用OGNL表达式语言访问静态方法和静态属性以及我遇到的问题和解决方法
- Struts2 如何使用OGNL表达式访问静态方法和属性
- Struts2中使用OGNL调用静态方法及静态属性
- Struts2 使用OGNL表达式访问ENUM对象
- struts2_day01_14_Action的方法访问(使用method属性)
- ognl表达式访问普通属性和静态方法
- 关于struts2中使用OGNL表达式取值,取不到值的原因及解决方法
- 为何使用EL表达式能够访问valueStack中对象的属性、采用OGNL表达式创建List/Map集合对象
- Struts2属性驱动封装(了),需要使用ognl表达式
- struts2_ognl表达式符号的使用方法
- 使用struts2中的ognl表达式调用类方法
- Struts2学习——1400OGNL2访问方法与属性
- OGNL表达式和struts2中的使用
- 道听途说Struts2之19:OGNL访问静态方法,集合类
- struts2中OGNL中访问静态变量和静态方法
- OGNL表达式中的@..@..使用方法注意
- 反射:使用字符串访问类、方法和属性
- struts2中OGNL表达式的使用
- OGNL访问静态方法,静态属性,集合类等
- OGNL表达式的使用方法 .