1 Reply Latest reply on Mar 14, 2007 2:26 AM by roccolocko

    Simple user list on datatable

    roccolocko

      Hello, Im simply trying to display a list of the jbpm users and their passwords, something very similar to what the login.jsp does on the jbpm webapp but I simply can't get it to work, this is what I'm doing:

      private static List getUsers()
       {
       //Session session = JbpmContext.getCurrentJbpmContext().getSession();
       Session session = JbpmConfiguration.getInstance().getCurrentJbpmContext().getSession();
       IdentitySession identitySession = new IdentitySession(session);
       return identitySession.getUsers();
       }
      
       private static List createUsersList()
       {
       List usersList = new ArrayList();
       Iterator iter = getUsers().iterator();
       while (iter.hasNext())
       {
       User user = (User) iter.next();
       usersList.add(new Usuario(user.getName(),user.getPassword()));
       }
      
       return usersList;
       }
      


      then I try to use this to fill a datatable but doesn't work

      <h:dataTable value="#{loginBean.usersData}" var="user">
       <h:column>
       <h:outputText value="#{user.username}" />
       </h:column>
       </h:dataTable>
      


      The Usuario class is a simple class with only a constructor with setters an getters
      public class Usuario {
      
       private String username;
       private String password;
      
       public Usuario(String username, String password)
       {
       this.username = username;
       this.password = password;
       }
      . . .
      }
      


      The jsp gives me the next error
      javax.servlet.ServletException: Cannot get value for expression '#{loginBean.usersData}'
      


      I'm new to both JSF and jBPM, so I'm really not sure where the mistake could be but I pretty much follo the UserBean class on the jBPM webapp, just adding the Usuario class to fill both username and password.