How to come back to form without reset the values?

荒凉一梦 提交于 2019-12-25 02:22:21

问题


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&param2=2&param3=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


回答1:


Just add the parameters (/myForm?param1=1&param2=2&param3=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...



来源:https://stackoverflow.com/questions/9428248/how-to-come-back-to-form-without-reset-the-values

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!