How to retrieve checkbox values in Struts 2 action class ?

后端 未结 2 700
日久生厌
日久生厌 2021-01-07 06:29

I have dynamic number of checkboxes in jsp page as given below.


         

        
2条回答
  •  执笔经年
    2021-01-07 07:14

    Actually I use Struts 2 3.8 and WebSphere 7.0 and Map works for rendering the check boxes, but not working when these check boxes post back. The Boolean class is rendered correctly, but during the post back in Struts 2, it becomes ognl.NoConversionPossible and ends up with No result defined for action CLASS ...and result input error.
    I replaced Boolean with String class, i.e.

    maps.put(new Integer(0), new String("true")); 
    

    and it works for me.

提交回复
热议问题