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

在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)">

  

 

 

  

  

 

posted @ 2016-06-02 11:27  wujixing909  阅读(428)  评论(0编辑  收藏  举报