How can i get checkbox values from struts2 checkbox in displaytag to action class

前端 未结 2 1992
半阙折子戏
半阙折子戏 2021-01-15 18:30

I am working on struts2 application in which i am using displaytag for pagination support.

Now i want a check box for each row in t

2条回答
  •  终归单人心
    2021-01-15 18:54

    This is how I would do it.

    1. instead of 'id' for all id columns, append a sequence number so that each id has a unique name, such as 'id1', 'id2' etc

    2. create a interceptor that collects values of parameters prefixed with 'id'

    3. configure your action to use the interceptor

    My strut fu is rusty though. There probably is a better way.

提交回复
热议问题