码迷,mamicode.com
首页 > 其他好文 > 详细

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

时间:2016-06-02 13:21:01      阅读:131      评论: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
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!