How to check list.contains in jsp using struts 2 tags

前端 未结 1 1723
迷失自我
迷失自我 2021-01-22 10:44

I need to show a series of check boxes and if a condition is succeeded, I need to check them. Below is my code. I have regions which is a hashmap and SelectedRegions which is

1条回答
  •  执念已碎
    2021-01-22 11:17

    There are really many ways to do this. You should also check out the and tags;

    Also note that to follow DRY, you could put the around the checked="checked" part only, since all the rest is the same.

    Keeping it simple, with your code as-is, one way consists in using OGNL's in (contains) and OGNL's {} (list projection) like follows:

    
        
  • checked = "checked" name = "theaterCheckBox" class = "theaterCheckBox" />
  • 0 讨论(0)
提交回复
热议问题