java - How to get email addresses of all users in liferay -


i want email addresses of users in liferay...
have used following code..

dynamicquery dynamicquery = userlocalserviceutil.dynamicquery(); dynamicquery.add(restrictionsfactoryutil.isnotnull("emailaddress")); int startoflist = 0; int endoflist = 100; list<user> articles = (list<user>) userlocalserviceutil.dynamicquery(dynamicquery, startoflist, endoflist); 

can tell me doing mistake.

i getting:

  1. java.lang.instantiationexception and
  2. com.liferay.portal.kernel.deploy.hot.hotdeployexception: error registering portlets controlpanelportlet-portlet.

controlpanelportlet name of portlet.

try code..

list<user> users = userlocalserviceutil.getusers(0, userlocalserviceutil.getuserscount());  for(user user : users) {      system.out.println(user.getemailaddress()); } 

let me know if have problem


Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -