How to fetch object properties from selected object in Struts 2

后端 未结 1 814
清歌不尽
清歌不尽 2021-01-14 12:09

I have a list of City objects with name and id fields. I use Struts2 and I a have jsp page with a select tag.



        
相关标签:
1条回答
  • 2021-01-14 12:55

    To set id to the value of the select tag you should use additional attributes

    <s:select label="Source city" 
              list="cities" 
              listKey="id"
              listValue="name"
              name="sourceId"/>
    
    0 讨论(0)
提交回复
热议问题