struts2里怎么用脚本取session

来源:百度知道 编辑:UC知道 时间:2024/06/15 04:59:19
各位见笑了,
就是在<% %>里面怎么取session的值
我在action里这样放的:
ActionContext.getContext().getSession().put("AllChecked",set);

<% String session = request.getSession().getAttribute(Key)%>
Key就是你要取Session中的Key值

HttpSession session = ((HttpServletRequest) request).getSession();

session.getAttribute("AllChecked");

<s:property value="#session.AllChecked"/>

<% String session = request.getSession().getAttribute(Key)%>
Key就是你要取Session中的Key值