spring mvc- form submit back button

允我心安 提交于 2020-01-15 12:26:28

问题


I have a simple jsp form (page1.jsp)that allows the user to enter a bunch of textboxes. The submit button posts the form and displays page2 On Page2- there is a tab called Page1- on clicking this tab, the user should be able to view page1 with all the information that he entered, so that he can edit it ,if he chooses to.

I have my controller set up for the first part page1- page2, working correctly. However I am not sure how to implement the second part page2 ->page 1. I am unable to show the filled out form from the previous page.

I am not very proficient in Spring MVC and would appreciate some guidance.

Thanks


回答1:


You can do this using two approaches . if you wish to use @ModelAttribute annotation and spring:form tags. you can use the form backing option to remember the values in the page.

  1. Spring MVC example
  2. Spring Form handling

or you can do them in the native session handling .put your data to the session and then retrieve them when you go the prev page

Hope this helps !



来源:https://stackoverflow.com/questions/26526010/spring-mvc-form-submit-back-button

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