LabelValueBean

来源:互联网 发布:mac口红滋润系列 编辑:程序博客网 时间:2024/04/29 08:38

    private List getSports()
    {
        List sports = new ArrayList();

        sports.add(new LabelValueBean("Tennis", "Tennis"));
        sports.add(new LabelValueBean("Hockey", "Hockey"));
        sports.add(new LabelValueBean("Football", "Football"));
        sports.add(new LabelValueBean("Baseball", "Baseball"));
        sports.add(new LabelValueBean("Soccer", "Soccer"));

        return sports;
    }

 

  <html:select property="favSport">
       <html:option value="">Please choose</html:option>
       <html:options collection="sports" property="value" labelProperty="label"/>
   </html:select>