In the code below what would be my ActionForm class,
and what all attributes will it have and of which type,
do we need a City class too.. 




I am gettin  an error HTML BEAN tag not found... so i
guess some prroblem with the jsp/form....

<layout:select key="Country" property="country" styleClass="FIELD">                    
                 <layout:option value=""/>       <layout:options 
collection="countries" property="name" sourceOf="city"/></layout:select>               
                 <layout:select key="City" property="city" styleClass="FIELD">   
<layout:optionsDependent collection="cities" dependsFrom="country"/></layout:select>   
         


The model object is as follow: 

public class Country {  private String name;    private List cities = new ArrayList(); 
         public Country(String in_name) {                name = in_name; }             
  public String getName() {               return name;    }               public List 
getCities() {               return cities;  }               public void addCity(String 
in_city) {           cities.add(in_city);    }}                                      
A list of Country object is put directly in the request scope under the key 
"countries". 
The Struts form has 2 properties country and city. 


Yahoo! India Matrimony: Find your partner online.

Reply via email to