Search code examples
jspjakarta-eestruts-1

binding bean property with multiple objects in struts


Is this possible to bind a strut-1 Bean property to multiple form elements?for example, i am dynamically creating rows and each row has a drop down, can i bind all those drop downs with single Bean property (something like values in array) so i can fetch the values of all drop downs easily.

thanks


Solution

  • Yes. Name all your select boxes the same way (foos, for example), and have a method

    public void setFoos(String[] foos) {
        ...
    }
    

    in your form bean.