如何在不重置值的情况下返回表单?
我有一个用 Java+Struts 制作的 Web 应用程序。
有一个表单,当提交时它会执行一个显示搜索结果的操作。
自从来到这里,一切都好。
我需要的是在结果页面中放置一个链接以返回表单而不删除搜索参数。
我放置了一个返回表单页面的链接,但始终删除搜索参数。
我正在考虑将此参数保存并恢复到java会话中,或者将参数添加到url中(例如:/myForm?param1=1¶m2=2¶m3=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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
只需将参数 (/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...