Struts logic:iterate input field

后端 未结 4 2028
悲哀的现实
悲哀的现实 2021-01-03 07:37

I currently have the following code and the data is displayed fine.



        
4条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-01-03 08:16

    Take a look at this: http://wiki.apache.org/struts/StrutsCatalogLazyList

    Indexed Properties

    Struts html tags have an indexed attribute which will generate the appropriate html to populate a collection of beans when the form is submitted. The trick is to name the id attribute to the same as the indexed property.

    For example the following jsp...

       
    
           
    
       
    

    ...will generate the following html

    
    
    ....
    
    

    When the form is submitted BeanUtils will first call the getSkills(index) method to retrieve the indexed bean followed by setSkillId(..) on the retrieved bean.

提交回复
热议问题