Wednesday, August 16, 2017

Quick access to httpSession in Liferay

The following syntax can access to Http Session Object in Liferay without going through PortletSession Object.

Setting session object

PortalSessionThreadLocal.getHttpSession().setAttribute("sessionAttributeName", value); 



Retrieving session object by key 

PortalSessionThreadLocal.getHttpSession().getAttribute("sessionAttributeName");




Done!!

Monday, August 7, 2017

How to disable Chrome autofill with jQuery

To disable the Google Chrome autofill,
the solution is to set the autocomplete in the input element to off.
with the following jQuery function, all the input element in the page will be set autocomplete to off.

$(document).ready(function(){ 
    $("input").each(function () {
         $(this).attr("autocomplete", "off");
       })
})



Done!!

LinkWithin

Related Posts Plugin for WordPress, Blogger...