Portlets - Keeping session alive from server side

Portlets - Keeping session alive from server side

I am implementing jsr 186 portlets, with some servlets to the mix to implement some ajax. The problem is if I only make AJAX calls for some time, I lose the session. Strangely, keeping alive the servlet session does not prevent the portlet session from timing out.

Is there a way I can keep the session alive from within my servlets, on the server side?

FWIW I'm using spring and spring mvc/portlet.

Thanks, Miguel Ping

Are there Compound property values in Spring


Spring Security: Authentication returns null
I had the same problem.

Is Spring able to handle this user case? Neither property nor constructor injection
(Using OpenPortal Portlet Container).
Using Multiple ApplicationContexts in Spring - question about cleaning up resources
As I know there is two different sessions, 1- portlet session, 2- Container session..
Spring Framework Connecting JVM with each other
I created a simple portlet and made request to the portlet with ajax periodically from container.

Retrieving a model from ModelAndView in jsp
However, session times out.

binding to a Set in Spring
My code fraction is here:.
Quartz JobStore with Spring Framework
<%     int per=15000; //ms     String sessionExtenderPath = "http://portal.abc.com.tr:8080/SessionExtend/SessionExtend";     //This is a portlet which includes servlet that returns a simple string. 

%> <script> periyod=100; function invokeRequest(){ $.get("< %=sessionExtenderPath% >", function(data) { alert(1); }); } window.setInterval("invokeRequest()",periyod); </script>
I have solved my problem by requesting container page (wihout defining a channel for a portlet).. Thanks for edit..


I implemented it using a javascript timer that kept polling a portlet url.

The portlet url was generated beforehadn so it was accessible in javascript..

76 out of 100 based on 56 user ratings 1006 reviews