ITeye博客

Struts获取Session

xiajin2080 · 2009-02-10 11:29 · Struts2.0 · Markdown

1.
    Map session=ActionContext.getContext().getSession();
    session.put("xiajin", "test");
2.
    HttpSession httpSession=ServletActionContext.getRequest().getSession();
    httpSession.setAttribute("test", "jin");

    <s:property value="#session.xiajin"/> <br>
    <c:out value="${test}"></c:out>

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。