GTNPORTAL-3351 GTNPORTAL-3371

This should go to master only (There is separate PR https://github.com/gatein/gatein-portal/pull/767 for applying GTNPORTAL-3371 into 3.6.x branch)