Forums de discussion

Retrive details like name and email of users of liferay

Naitik Patel, modifié il y a 10 années.

Retrive details like name and email of users of liferay

New Member Publications: 3 Date d'inscription: 07/10/13 Publications récentes
i Want to display a list of users of liferay who are created account along with name and Email id with using of liferay services of portlet-client jar file. I just want to expand the or reuse of liferay services.
i am new on liferay.


Thanks in advance. emoticon
Naitik Patel, modifié il y a 10 années.

RE: Retrive details like name and email of users of liferay

New Member Publications: 3 Date d'inscription: 07/10/13 Publications récentes
I got the sollution..

emoticon
Naitik Patel, modifié il y a 10 années.

RE: Retrive details like name and email of users of liferay (Réponse)

New Member Publications: 3 Date d'inscription: 07/10/13 Publications récentes
Java ocde.

  try{
	        int totalUsers = UserLocalServiceUtil.getUsersCount();
	        List<user> users = UserLocalServiceUtil.getUsers(0, totalUsers);
	       // System.out.println(totalUsers);
	        List<string> myList = new ArrayList<string>();
	       	        for(User user: users){
	       	     //    System.out.println("name:" +user.getFullName());
	       	        	myList.add(user.getFullName());
        	}   
	        actionRequest.setAttribute("users", myList);
        }catch(Exception e){
        	System.out.println("error "+ e.getMessage());
}
</string></string></user>

view.jsp code

 <p>&lt;%
List<string> users = (List<string>) request.getAttribute("users");
out.println(users.size()+"<br>");
for(String user: users){
	out.println(user + "<br>");
}
%&gt; </string></string></p>  



Naitik Patel:
I got the sollution..

emoticon