I have a jsp form that has two submit buttons; save and reset. The
form submits to a SimpleFormController with the following onSubmit
method:
The success view for this controller is a redirect to a ControllerCode:public ModelAndView onSubmit(...) throws Exception { if (request.getParameter("reset") != null) { this.settingsManager.reset(); } else { this.settingsManager.setSettings((Settings) command); } return new ModelAndView(new RedirectView(this.getSuccessView())); }
with the following handleRequest method:
So, when the user hits the save button, the settings form is submittedCode:public ModelAndView handleRequest(...) throws Exception { return new ModelAndView("addressList", this.settingsManager().getSettings()); }
and the settings manager sets the Settings to the given command
values. When the user hits the reset button, the settings manager
sets the Settings to their default values. Everything works fine,
except that when the reset submit button is hit, the resulting view is
pulled from Spring's cache instead of being re-generated. The user
sees the old settings instead. This does not happen when the user
hits save though. The new settings are seen in the view.
What's going on here? Am I supplying enough info? I've looked all
through the API and the documentation. I don't see anything about
troubleshooting caching. I tried adding this.preventCaching() in my
SimpleFormController, but it didn't change anything. Any ideas?
Thanks,
Brian


Reply With Quote