ActionContext.getContext().getSession()

ActionContext.getContext().getSession() 获取的是session,然后用put存入相应的值,只要在session有效状态下,这个值一直可用
ActionContext.getContext().getSession() .put("键","要存放的值");   // 例如在user的setter和getter方法,要放的值相当于getUser()

相当于jsp里

<%=session=getAttribut("键")%>

 

 

 

 

 

 

 

 

 

************************************************************************************

posted on 2016-11-04 14:19  Honey_Badger  阅读(925)  评论(0编辑  收藏  举报

导航

github