您的位置:首页 > 理论基础 > 计算机网络

如何设置让portlet session和http session变成一个session

2008-05-29 15:23 232 查看
#1 找到tomcat/conf/server.xml配置文件,找到相应端口号的Connector元素。然后配置emptySessionPath="true"。
eg:<Connector port="8080" maxHttpHeaderSize="8192" maxThreads="150" minSpareThreads="25" maxSpareThreads="75" enableLookups="false" redirectPort="8443" acceptCount="100" connectionTimeout="20000" disableUploadTimeout="true" emptySessionPath="true" />
#2 在类中session.setAttribute时注意加上PortletSession.APPLICATION_SCOPE。
eg:request.getPortletSession().setAttribute(Constants.SESSION_ALERT,a,PortletSession.APPLICATION_SCOPE); request.getPortletSession().getAttribute(Constants.SESSION_ALERT,PortletSession.APPLICATION_SCOPE);
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  session portlet