Friday, 24 November 2017

Sharing value between hooks and portlets

In Hooks:

HttpSession session = request.getSession(false);
String token = “Welcome”;
session.setAttribute("LIFERAY_SHARED_newtoken"token);


In Portlets:

HttpSession session2 = request.getSession();
String sess1 = (String)session.getAttribute("LIFERAY_SHARED_newtoken");


We need to use LIFERAY_SHARED_ as prefix in liferay to share.

TEST

I am Java Developer. I have 6 year Experiance in this field and like to post in blogging. So keep sharing and like my post

0 comments:

Post a Comment

 

Copyright @ 2017 Liferay Article.