Skip to content

Instantly share code, notes, and snippets.

@rponte
Created December 26, 2013 11:45
Show Gist options
  • Save rponte/8132761 to your computer and use it in GitHub Desktop.
Save rponte/8132761 to your computer and use it in GitHub Desktop.
Simple managed bean to list all users by name
@ManagedBean
public class UserBean {
private String name;
private List<User> users = new ArrayList<User>();
public String listAll() {
UserDao dao = new UserDao();
this.users = dao.findByName(name);
return "list";
}
public List<User> getUsers() {
return this.users;
}
// other gets and sets
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment