Foros de discusión

How to hold the un till user logs out in liferay 6

Kiran Kumar Boyini, modificado hace 11 años.

How to hold the un till user logs out in liferay 6

Expert Mensajes: 287 Fecha de incorporación: 2/06/11 Mensajes recientes
Hi All,

I have a requirement.I want to hold some string value say "xyz" untill the user logs out.

I have tried it by putting the value in session object.But it is reflecting in the same portlet after login, but not in the another portlet.

I dont know why? according to my knowledge it you put some value or object inside the session, it should be available through out the user session.

But in my practice it is not happening. Please observe the code

In class:

                              HttpServletRequest request = PortalUtil.getHttpServletRequest(actionRequest);
				HttpSession session = request.getSession();
				session.setAttribute("hiddenRoleId1", hiddenRoleId);

In jsp which is in some other portlet :

hiddenRoleId1=(String)session.getAttribute("hiddenRoleId1"); 
out.print("hiddenRoleId1 --->"+hiddenRoleId1);



Please provide the suggestion or am I missing any thing.
Regards,
Kiran
thumbnail
Bart Simpson, modificado hace 11 años.

RE: How to hold the un till user logs out in liferay 6

Liferay Master Mensajes: 522 Fecha de incorporación: 29/08/11 Mensajes recientes
I haven't chekced by running your code, but if it helps you can add the attribute using Liferay's shared variables.
Just add them of the form (LIFERAY_SHARED_yourCustomName)
More details on this one are in the portal.properties file:

    #
    # Portlets that have been configured to use private request attributes in
    # liferay-portlet.xml may still want to share some request attributes. This
    # property allows you to configure which request attributes will be shared.
    # Set a comma delimited list of attribute names that will be shared when the
    # attribute name starts with one of the specified attribute names. For
    # example, if you set the value to "hello_,world_", then all attribute names
    # that start with "hello_" or "world_" will be shared.
    #
    request.shared.attributes=LIFERAY_SHARED_
thumbnail
Bart Simpson, modificado hace 11 años.

RE: How to hold the un till user logs out in liferay 6

Liferay Master Mensajes: 522 Fecha de incorporación: 29/08/11 Mensajes recientes
Also take into account the value of
<private-session-attributes></private-session-attributes>
in your liferay-portlet.xml
Further reference
http://www.liferay.com/zh/community/wiki/-/wiki/Main/Portlet+to+Portlet+Communication