首页 > 其他 > 详细

Struts2---OGNL表达式和EL表达式

时间:2016-06-02 13:20:25      阅读:208      评论:0      收藏:0      [点我收藏+]

在action里放入actioncontext的变量值

ActionContext.getContext().put("forumList", forumList);

在jsp里如何取出, OGNL方式:

<s:iterator value="#forumList">
<s:property value="#request.name"/>

EL方式:

<s:iterator value="#forumList">
  ${name}

 

 

 

在action里放入valuestack的值

ActionContext.getContext().getValueStack().push(forum);

在jsp里取出

 <td><s:textfield name="name" cssClass="InputStyle" /> *</td>
 <td><s:textarea name="description" cssClass="TextareaStyle"></s:textarea></td>

  

在action里放入session

ActionContext.getContext().getSession().put("user", user);

jsp里取出

<s:if test="#session.user.hasPrivilegeByName(name)">

  

 

 

  

  

 

Struts2---OGNL表达式和EL表达式

原文:http://www.cnblogs.com/wujixing/p/5552394.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!