掲示板

Portlet, Servlet & HttpSession

14年前 に Francesco Rossi によって更新されました。

Portlet, Servlet & HttpSession

New Member 投稿: 2 参加年月日: 09/12/17 最新の投稿
Hello everyone.

I'm writing about a problem involving HttpSession and PortletSession.

My portlet contains a servlet mapped under its context. The portlet Edit Page calls asynchronously that servlet to retrieve a jsp, still in the context. The configuration I use is similar to that described here. It works well, but I can't share object through a common session.

I've tried to follow a few suggestions and wiki faq, even if the application context is the same .

This code won't work either:

MyPortlet
HttpSession session = PortalUtil.getHttpServletRequest(renderRequest).getSession();
session.setAttribute(CONFIG_FORM, configForm);


Servlet and jsp
HttpSession session = request.getSession();
ConfigForm form = (ConfigForm) session.getAttribute(MyPortlet.CONFIG_FORM);


The result is that I obtain two different sessions (IDs don't match).

Any idea?

Thank you in advance.
12年前 に Juraj Lonc によって更新されました。

RE: Portlet, Servlet & HttpSession

New Member 投稿: 9 参加年月日: 11/12/03 最新の投稿
I had very similar problem.

I have figured out that it was caused by combination of using MSIE and "localhost" address.
When I used IP address or hostname in URL, than it worked OK.


Are you using MSIE, or "localhost" address in browser URL?
10年前 に Arvind Gupta によって更新されました。

RE: Portlet, Servlet & HttpSession

Junior Member 投稿: 29 参加年月日: 12/12/18 最新の投稿
Thanks It worked for me