留言板

Unable to acess customdata from request obj after postloginhook

ramakanth reddy,修改在10 年前。

Unable to acess customdata from request obj after postloginhook

Junior Member 帖子: 27 加入日期: 13-4-17 最近的帖子
I have created a post login hook in Liferay 6.1 by specifying the following key in portal.properties as below:

portal.properties file:
login.events.post=com.liferay.portal.kernel.events.MyPostLoginAction

I have set some data in post Login Hook as below:

Map<String, Object> vmVariables=new HashMap<String, Object>();
vmVariables.put("categories1", customObj);
vmVariables.put("mySiteName", "Liferay-OpenSourceForLife");

I have into request Object as follows:

httpServletRequest.setAttribute(WebKeys.VM_VARIABLES, vmVariables);

Even i tried to set in session also:

httpServletRequest.getSession().setAttribute(WebKeys.VM_VARIABLES, vmVariables);

But i am unable to access the custom data in navigation.vm:


Code in navigation.vm:
$categories1.getServices()
$mySiteName

It doesn't return any data for both variable in UI it prints as it is.