掲示板
portletRequest.getPortletSession() returns null
9年前 に Rafael Rodrigues によって更新されました。
portletRequest.getPortletSession() returns null
New Member 投稿: 3 参加年月日: 14/08/21 最新の投稿
In my project, I want to use Liferay Login to autenticate the users, for that, I developed a hook that adds functionalities to the liferay login, the rest of the project is adapted from a one previously developed for IBM websphere and its located in another war file.
I guess there is no problem, but this project requires some login information saved in PortletSession, like the userName, sessionUuid...
I tried this:
but it returns null for the PortletSession.
So my question is: How do I transfer this information from the plugin to the application PortletSession?
Thanks in advance!
I guess there is no problem, but this project requires some login information saved in PortletSession, like the userName, sessionUuid...
I tried this:
PortletRequest portletRequest = (PortletRequest) request.getAttribute(JavaConstants.JAVAX_PORTLET_REQUEST);
PortletSession session = portletRequest.getPortletSession();
session.setAttribute("TEST_PORTLET_SESSION", "GOT_THERE", PortletSession.APPLICATION_SCOPE);
session.setAttribute("webtoolPortlets."+"sessionUuid", session.getId(), PortletSession.APPLICATION_SCOPE);
but it returns null for the PortletSession.
So my question is: How do I transfer this information from the plugin to the application PortletSession?
Thanks in advance!
9年前 に David H Nebinger によって更新されました。
RE: portletRequest.getPortletSession() returns null
Liferay Legend 投稿: 14919 参加年月日: 06/09/02 最新の投稿
First, this thread has nothing to do with your request, you should have started a new thread...
That said, application scope only works between portlets in the same war file. if you are in different wars, then you need a completely different mechanism. I'd suggest cookies for client side or database for server side.
That said, application scope only works between portlets in the same war file. if you are in different wars, then you need a completely different mechanism. I'd suggest cookies for client side or database for server side.
9年前 に Subhasis Roy によって更新されました。
RE: portletRequest.getPortletSession() returns null
Expert 投稿: 275 参加年月日: 12/01/20 最新の投稿
you can try the following -
PortletSession portletSession = renderRequest.getPortletSession();
portletSession.getAttribute("param1" ,PortletSession.APPLICATION_SCOPE);
9年前 に Andew Jardine によって更新されました。
RE: portletRequest.getPortletSession() returns null
Liferay Legend 投稿: 2416 参加年月日: 10/12/22 最新の投稿
I think David already explained that APPLICATION_SCOPE only works when plugins are in the SAME war file. The original post states that he has more than one war file, so APPLICATION_SCOPE won't help here.
9年前 に Subhasis Roy によって更新されました。
RE: portletRequest.getPortletSession() returns null
Expert 投稿: 275 参加年月日: 12/01/20 最新の投稿
i think, you can try for IPC mechanism