You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Daniel Blázquez <da...@donewtech.com> on 2003/12/02 17:55:34 UTC

[struts-nested] BeanUtils.populate exception

Hi,

I have been dealing with struts-nested taglibs for a few days (with the
unestimable help from Arron Bates in http://www.keyboardmonkey.com) and with
the great amount of messages of this topic in the mailing list. But I still
have the next problem:

javax.servlet.ServletException: BeanUtils.populate
  at org.apache.struts.util.RequestUtils.populate RequestUtils.java:1254)

(no extra info about ArrayIndexOutOfBounds or a more detailed exception)

when submitting a form that uses a nested collection of objects. Each object
is showing in the form a <select> and a <input text> box (as a form showing
monkeys, each monkey with a box for age and a <select> for size).

<nested.form action="xxxx">

  <nested:iterate property="monkeys">

    <nested:write property="name"/>
    <nested:text property="age" size="10"/>
    <nested:select property="size">
      <nested:options property="../sizesList"/>
    </nested:select>

  </nested:iterate>

</nested.form>

The form also has many more properties (including checkboxes and simple
selects) but these ones work correctly.

Things I have already done:

-- Initialize involved property according to thread
http://nagoya.apache.org/eyebrowse/BrowseList?listName=struts-user@jakarta.a
pache.org&by=thread&from=240019
(thanks Arron again and Brandon)

-- provide setter in the form for the nested property with the signature:
public void setMonkeys(Object[] newMonkeys)

-- provide setter in nested monkey object for the size
public void setSize(String newSize)

I am really frustated because 'cant see what I am doing wrong!, any help
will be very appreciated

TIA,
Daniel


********************************************
Name: Daniel Blázquez
ITConsultant
Company: Donewtech Solutions, S.L.
Zuatzu Business Park, Urumea Building
E-20018 San Sebastian
Tel.: +34 943223031
Fax:  +34 943316385
Email:Daniel.Blazquez@donewtech.com
Internet: http://www.donewtech.com
********************************************


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


[OT] Role-based security, how to switch "active" role

Posted by "Richard Mixon (qwest)" <rn...@custco.biz>.
We are considering assigning multiple roles to some users/principals in our Struts 1.1 application. The alternative is to have to
give some users multiple login ids, which does not seem attractive. J2EE, Struts and Tomcat all seem to support multiple roles.

BACKGROUND:

I took a look at creating the logic to figure out how the various roles act when combined - its complex, but doable.  But the view
of data the user might see in such a situation may be confusing.

My inclination is to build support for a concept of the "active". User's with multiple roles could, at will, switch which role they
were playing. The current "active" role will of course be stored in the user's session.

Examples of our roles might be the following three:

  STDUSER - allows a user to maintain a set of data on the system that applies mostly to them. Their data will reference "common"
data that is maintained by the organization.
  ORGADMIN - maintains the "common"/shared data that is referred to by all.
  HELPER - allows an expert user to view data created by others with the STDUSER role, but not update the data. They help less
experience users.

The roles authorize actions at two levels.

1) Standard J2EE security can use the rols to decide which actions/pages a user can switch to/see.

2) Additional business logic decides what particular subset of data the user will see, depending on their role, on a given page.

The users will not need to switch roles often, and there will be a default role defined for each user.

MY QUESTIONS:

1) Is this a good approach or are there better alternatives?

2) How can I put a "mini" form in my header that supports switching roles, but still stay on the current screen so that subsequent
actions will take this new active role into account. My understanding is that only a single form can be submitted. Most of my pages
have a main form, and then would have this "mini" form for switching active roles.

Thanks - Richard



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