Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Brett Conoly
[RESOLVED] Sharing sessions between portlets and servlets
June 2, 2008 11:06 AM
Answer

Brett Conoly

Rank: Regular Member

Posts: 118

Join Date: July 19, 2007

Recent Posts

Ok, don't know how this happened but basically this was working and then it stopped and I don't know how to fix it!

The problem is that we are using Spring webflow to control the flow of all of our portlets and one of which contains the fckeditor. In the fckeditor we have several plugins using servlets controlled using the Spring MVC.

In order to share data between the portlets and the servlets without holding the data on the session, we use a singleton containing a map of the session.id and the data we want.

Previously the sessions between the portlets and servlets were the same and we could find the data easily using the session.id. Unfortunately something happened and now the portlets have one session and the servlets have another session so our logic is now flawed in that we cannot get the data that we want.

Has anyone seen this problem? Could it be some liferay configuration somewhere that we may have set up wrong?

Thanks in advance,
Raju Uppalapati
RE: Sharing sessions between portlets and servlets
May 31, 2008 9:31 PM
Answer

Raju Uppalapati

Rank: Junior Member

Posts: 66

Join Date: October 24, 2007

Recent Posts

What is your webcontainer?
Are all the portlets and the Servlets in the same WAR file. If not and you are running on Tomcat check if the crossContext session sharing is set to true for your WAR files.
--------------------
<Context path="/portlet" docBase="/web'" crossContext="true" debug="0" reloadable="false" trusted="false" />
--------------------

_raju
Manish Kumar Gupta
RE: Sharing sessions between portlets and servlets
June 1, 2008 7:29 AM
Answer

Manish Kumar Gupta

LIFERAY STAFF

Rank: Liferay Master

Posts: 535

Join Date: May 15, 2008

Recent Posts

By any chance, is your servlet being accessed directly through browser bypassing the portlet application (i.e. your servlet is not getting request through request dispatching thru portlet)?? In that also, the session in servlet and portlet will be different.

did you checked following??
http://opensource.atlassian.com/confluence/spring/pages/viewpage.action?pageId=3131
Brett Conoly
RE: Sharing sessions between portlets and servlets
June 2, 2008 5:55 AM
Answer

Brett Conoly

Rank: Regular Member

Posts: 118

Join Date: July 19, 2007

Recent Posts

Thanks for the reference, the problem was the emptySessionPath for the server config.