0
会话不与mod_jk负载均衡器(来自httpd Web服务器)一起使用。但是,相同的代码在应用程序服务器上工作正常。Liferay会话mod_jk问题
以下是worker.properties:
worker.list=loadbalancer,status,web
worker.node0.port=8009
worker.node0.host=10.50.26.19
worker.node0.type=ajp13
worker.node0.lbfactor=1
worker.node0.socket_keepalive=false
worker.node0.connect_timeout=10000
worker.node0.prepost_timeout=10000
worker.node0.socket_timeout=60
worker.node0.connection_pool_timeout=600
worker.loadbalancer.type=lb
worker.loadbalancer.balance_workers=node0
worker.loadbalancer.sticky_session=1
Java代码的Portlet 1:
PortletSession portletSession = actionRequest.getPortletSession();
portletSession.setAttribute("username",reg.getFname(), PortletSession.APPLICATION_SCOPE);
JSP代码中的Portlet 2:
PortletSession portletSessionobject = renderRequest.getPortletSession();
userName=(String)portletSessionobject.getAttribute("username",PortletSession.APPLICATION_SCOPE);
在这两个portlet中的以下属性已应用于liferay-portlet.xml中
<private-session-attributes>false</private-session-attributes>
但无法在Web服务器的Portlet 2 JSP页面中获取用户名,它将返回null。但在应用程序服务器中,价值如预期。请建议。