You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Chris Cranford <cr...@gmail.com> on 2009/11/21 02:18:33 UTC

Struts2 Tags Example

I am having trouble iterating/manipulating a collection via struts2 tags.

The layout of my entity object is this:

public class Role
{
  private String name;
  private String description;
  private Long id;
  private List<RoleFunctionAccess> roleFunctionAccess;
  // getter/setters and annotations
}

public class Function
{
  private String name;
  private String description;
  private String url;
  private Long id;
  // getter/setters and annotations
}

public class RoleFunctionAccess
{
  private Long roleId;
  private Long functionId;
  private Long accessFlags; // bitmask 1-View,2-Add,4-Modify,8-Delete
  // getter/setters and annotations
}

The above simply shows the relationship of the entity beans.  In the
rendered JSP page am aiming for something like this:

Role: ADMIN
Description: Administrator

Functions:
Admin Users             [  ] View  [  ] Add  [  ] Modify  [  ] Delete
Admin Customers     [  ] View  [  ] Add  [  ] Modify  [  ] Delete

My action renders the content from a display perspective ok, but it's
getting the checkboxes related to the functions configured properly so
that when the form is submitted that the appropriate
RoleFunctionAccess beans are updated with the correctly bitmasked
accessFlags values.

Can anyone help point me in the right direction?

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org