struts2 如何获取 session中的值

就是方法需要以前的session里面的用户名,如何通过session的获取值
session。setAttribute(“use”,use)
如何让在其它的action中取得use
如何获取session呢
LZ以后问这类问题 提前搜枯闭索下

struts2已经把session封装起来 想使用session需要继承歼败岁ActionSupport类 然后实现SessionAware接口 然后再实现他的setSession方法 就会氏睁从参数列表中获得一个MAP形式的SESSION 基本跟普通SESSION一样

不建议用LS那种方法
<s:textfield name="city"搏改 value="%{#session.mobileno}" />

<input type="慎锋text"宽银晌 name="actTel" id="actTel" value="<s:property value="#session.mobileno"/>"/>
先获得session:
HttpSession session =
ActionServletContext.getRequest().getSession
然兄笑后:session.getAttribute(""羡逗含);就指蠢行
session.getAttribute("use");就行了
一般提倡实现SessionAware接口