如何在不重置值的情况下返回表单?

发布于 2025-01-08 08:06:13 字数 338 浏览 4 评论 0原文

我有一个用 Java+Struts 制作的 Web 应用程序。

有一个表单,当提交时它会执行一个显示搜索结果的操作。

自从来到这里,一切都好。

我需要的是在结果页面中放置一个链接以返回表单而不删除搜索参数。

我放置了一个返回表单页面的链接,但始终删除搜索参数。

我正在考虑将此参数保存并恢复到java会话中,或者将参数添加到url中(例如:/myForm?param1=1&param2=2&param3=3),但我认为也许有更好的方法来做到这一点。

有什么办法可以用struts来做到这一点吗?

博士。 struts版本是1.3.8

I have a web application that is made with Java+Struts.

There is a form that when is submited it executes an Action that shows the results of the search.

Since here, all ok.

What I need is to put a link in the results page to come back to the form without erasing the search parameters.

I've put a link that goes back to the form page, but allways erase the search parameters.

I've thinking about saving and restoring this parameters to the java session, or adding the parameters to the url (like: /myForm?param1=1¶m2=2¶m3=3) but I think that maybe there is a better way to do this.

There is any way to do this with struts?

Pd. The struts version is 1.3.8

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

愁以何悠 2025-01-15 08:06:13

只需将参数 (/myForm?param1=1¶m2=2¶m3=3) 添加到返回搜索表单的按钮 URL 中即可。然后使用参数填充字段。无需使用会话变量。

除非我错过了什么...

Just add the parameters (/myForm?param1=1¶m2=2¶m3=3) to the button url that leads back to the search form. Then populate the fields using the parameters. No need to use session variables.

Unless i'm missing something...

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文