1

I have a form whose value get stored in the database on click of submit button.

Also there are 4 fields whose data is to be displayed into the struts2-jquery-grid. I first used a temporary table to save values and display those values in the grid. But this approach isn't correct as the values remain in the table even if the user doesn't click on submit.

So is there a way to temporary store the data of 4 fields into the array and display in the grid and then when user submits the data the values from the array(grid) are stored into the database.

4

1 回答 1

1

临时表不是您在帖子中提到的解决方案,但您可以使用会话映射来保存您的数组,然后再将其显示在网格中。当您提交表单时,可以将会话中的值检索回操作,并且可以清除会话映射。要将会话映射与操作一起使用,您应该实现SessionAware或从操作上下文中获取会话。请参阅答案以在 JSP 中使用会话。

于 2014-07-19T07:25:49.600 回答