struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bernard Willemot <>
Subject ActionForm with ArrayList - Validation Problem
Date Thu, 20 Jan 2005 00:50:42 GMT

Not sure it is the best practice...

I have a for to edit a user called UserForm. This form contains a popup
(<select>) with Customers.

I didn¹t find an easier way to include the data of the popup in the

Public class UserForm extends ActionForm {
    protected ArrayList customer_popup;


    public ArrayList getCustomerPopup() {
        return this.customer_popup;
    public void setCustomerPopup(ArrayList customer_popup) {
        this.customer_popup = customer_popup;

So before editing the user and while building the form, I build the form and
fill the ArrayList with the customers as well.

So far so good that works, but if I use validation, and the page with the
form needs be reloading to tell me what went wrong, I have the problem that
struts doesn¹t find the arraylist in the form anymore:

javax.servlet.ServletException: ServletException in
'/setup/users/edit_user_data.jsp': Failed to obtain specified collection

In the jsp, I use:

<html:select property='customerId'>
       <html:optionsCollection property='customerPopup' label='name'
value='id' />

If I remove it, it works fine.

Using struts 1.2.4 with TC 5.5.

Any idea?

Thank you, BW.

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message