Strust2 Action设置的session如何在porlet获取
2010-01-20 11:08
609 查看
在Strust2的Action或Servlet中设置了Session如
ServletActionContext.getRequest().getSession().setAttribute("session1","name");
如何在porlet的jsp/自定义标签获取session?
自定义标签中
PortletSession portletSession =(PortletSession)pageContext.findAttribute("portletSession");
String str =(String)portletSession.getAttribute("session1");
jsp中
String str =(String)portletSession.getAttribute("session1");
在strust2的Action中
org.apache.struts2.portlet.servlet.PortletHttpSession p = (org.apache.struts2.portlet.servlet.PortletHttpSession)ServletActionContext.getRequest().getSession();
PortletSession portletSession = p.getPortletSession();
String str =(String)portletSession.getAttribute("session1");
ServletActionContext.getRequest().getSession().setAttribute("session1","name");
如何在porlet的jsp/自定义标签获取session?
自定义标签中
PortletSession portletSession =(PortletSession)pageContext.findAttribute("portletSession");
String str =(String)portletSession.getAttribute("session1");
jsp中
String str =(String)portletSession.getAttribute("session1");
在strust2的Action中
org.apache.struts2.portlet.servlet.PortletHttpSession p = (org.apache.struts2.portlet.servlet.PortletHttpSession)ServletActionContext.getRequest().getSession();
PortletSession portletSession = p.getPortletSession();
String str =(String)portletSession.getAttribute("session1");
相关文章推荐
- JS获取action里session.put("sendMeg", message) 设置的值
- 如何在ashx页面获取Session值(未将对象引用设置到对象的实例) (转)
- action里面获取session以及获取设置session的属性
- Struts 2 的Action中如何获取request、response、session、application等web元素(1)
- 如何在ashx页面获取Session值(未将对象引用设置到对象的实例)
- Struts 2 的Action中如何获取request、response、session、application等web元素(2)
- 如何解决设置Session保存在StateServer后引起WebService/WebMethod无法异步获取Session
- 在struts2的action中获取或设置http型session变量的值
- struts2中action如何获取Session,jsp页面参数等等信息的值
- jsp如何获取struts2 action中值(普通属性,domain属性,集合,application,session.....)
- 如何在action和jsp中获取session
- struts2中action如何获取Session,jsp页面参数等等信息的值
- ajax异步处理时,如何在JS中获取从Servlet或者Action中session,request
- struts2中action如何获取Session,request,jsp页面参数等等信息的值
- struts2中action如何获取Session,request,jsp页面参数等等信息的值
- 关于ActionContext.getContext()取得的值是什么,和struts2如何获取request,session,appliaction作用域
- struts2中action如何获取Session,request,jsp页面参数等等信息的值
- 在struts2的action中获取或设置http型session变量的值
- struts2在struts.xml文件中获取或设置action中的属性
- 如何设置Cas 的session过期时间