|
|
Hi,
I am using spring MVC (2.0.6) for displaying my search results. After the search criteria form (SimpleFormController) is submitted, the results table is displayed with each row that has a hyper link to see the line item in detail. The item detail page opens in the same window upon clicking the hyperlink. From the item detail page, if the user clicks back button in Firefox browser, I am getting the following prompt and if you click OK it opens the results page.HTML Code:
The page you are trying to view contains POSTDATA that has expired from cache.
If you resend the data, any action the form carried out
(such as a search or online purchase) will be repeated.
To resend the data, click OK. Otherwise, click Cancel.
What is wrong I am doing?
Thanks,
Durga
try using method=quot;getquot; in the JSP on your search criteria form
Thanks for the tip and it solved the problem of above prompt. I have changed the form method to GET and overriden isFormSubmission() to return true in the SimpleFormController to support GET request. But now the problem is that when I visit search criteria page for the first time, the validator is kicking off displaying the error messages. I want the validator to be called only after form submission. How can I do this?
Look at the suppressValidation() method
I have solved this problem by using additional request parameter for the search page. This request parameter exists when the search criteria form first displayed and it does not exist when the form is submitted. The method isFormSubmission() returns true only when the form is submitted and hence prevented validator to kick off for the first time.
Code:
@Override
protected boolean isFormSubmission(fromServletRequest request){
return (request.getParameter(quot;searchPagequot;)==null?true:false);
}
In the JSP for search page:
lt;c:redirect ucl=quot;/processSearch.do?searchPage=truequot;/gt; |
|