当前位置: 代码迷 >> 综合 >> struts2使用OGNL表达式访问方法与属性
  详细解决方案

struts2使用OGNL表达式访问方法与属性

热度:48   发布时间:2023-10-26 09:17:57.0
	//访问静态变量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]"/>


  相关解决方案