我正在使用 Struts 2 和 Tiles 来开发应用程序。
我有 2 个 JSP 文件被加载到表的 2 个单独的单元格中(Tiles 概念)。第一个 JSP 有链接(使用<s:url/>
标签创建)。点击这些链接应该:
(a) 在第二个 JSP 中检索当前表单数据(单选按钮组中选择的值、复选框组中选择的值和文本字段中的值)并更新数据库,
(b) 然后必须获取不同的数据来填充第二个 JSP。
我如何实现 (a)?
In the s:form
tag, specify an action
. The form will be submitted to this Action class. It must also contain setters for each of your form fields. You can then process the user submitted data in that action's execute
method.
您可以尝试使用 ajax 而不是瓷砖。不过,您必须将第一个和第二个 JSP 组合成一个 JSP。