
|
If you were logged in you would be able to see more operations.
|
|
|
|
Environment:
|
Windows XP SP2, RHEL4.0 , Bea Weblogic 9.2,
|
|
Issue Links:
|
Related
|
|
This issue is related to:
|
|
|
SPR-4160 @SessionAttributes doesn't work with tabbed browsing
|
|
|
|
|
|
This issue is related to:
|
|
|
SPR-4011 Add support for outputting a 'dialog key', like a Web Flow execution key, when using the form tag.
|
|
|
|
|
|
|
| Virtual Machine: |
BEA JRockit JVM
- 5.0
|
| Platform: |
BEA WebLogic
- 9.0
|
|
Hi, There seem to be a bug in the AWFC, I have logged this in the forum, but I didnt get any replies.
I have been using AbstractWizardFormController, it works fine during the normal flow of execution.
Scenario:
the AWFC has three pages.
page1, page2, page3.
All of the pages have some validations to be done.
1. the user issues a get request to the AWFC and the first page is displayed
2. The user submits the page1, the target is the page2. everything works fine till now, the user is shown the page2
3. The user now refreshes, for some reasons the page2 gets validated , which must not happen. becuase the user has refreshed the post request of the page1.
Looking into the code of the AbstractWizardFormController in the processFormSubmission(...) method, line number 494 (spring 2.0.6) there is a check that happens.
Code:
// Normal submit: validate current page and show specified target page.
if (!suppressValidation(request, command, errors)) {
if (logger.isDebugEnabled()) {
logger.debug("Validating wizard page " + currentPage + " for form bean '" + getCommandName() + "'");
}
validatePage(command, errors, currentPage, false);
}
.
which should be there incase of normal flow of the AWFC.
but since the page1 was validated and the page2 was shown, because of this there is call to the showPage(request, errors, targetPage) at line number 513.
as a result a session attribute is set in the showPage method at line number request.getSession().setAttribute(pageAttrName, pageInteger); 341.
Now back to the scenario.
page1 is submitted, the targetPage is 1 as a result the session has the attribute pageAttrName as 1. the page2 is shown as a result of the page1 submission which is normal.
now when the user refreshes the page2(resubmits the page1 post request). the validatePage is called from the processFormSubmission and the page2 gets validated which shouldnot happen,
Iam assuming that the fix to this would be to add an additional check in the if construct of the AWFC line 494,
Code:
// Normal submit: validate current page and show specified target page.
// determine the targetPage by calling the getTargetPage() method and add the following .
if (targetPage != currentPage && !suppressValidation(request, command, errors)) {
if (logger.isDebugEnabled()) {
logger.debug("Validating wizard page " + currentPage + " for form bean '" + getCommandName() + "'");
}
validatePage(command, errors, currentPage, false);
}
.
This should handle the refreshes without calling validate.
Kindly let me know if this is correct.
|
|
Description
|
Hi, There seem to be a bug in the AWFC, I have logged this in the forum, but I didnt get any replies.
I have been using AbstractWizardFormController, it works fine during the normal flow of execution.
Scenario:
the AWFC has three pages.
page1, page2, page3.
All of the pages have some validations to be done.
1. the user issues a get request to the AWFC and the first page is displayed
2. The user submits the page1, the target is the page2. everything works fine till now, the user is shown the page2
3. The user now refreshes, for some reasons the page2 gets validated , which must not happen. becuase the user has refreshed the post request of the page1.
Looking into the code of the AbstractWizardFormController in the processFormSubmission(...) method, line number 494 (spring 2.0.6) there is a check that happens.
Code:
// Normal submit: validate current page and show specified target page.
if (!suppressValidation(request, command, errors)) {
if (logger.isDebugEnabled()) {
logger.debug("Validating wizard page " + currentPage + " for form bean '" + getCommandName() + "'");
}
validatePage(command, errors, currentPage, false);
}
.
which should be there incase of normal flow of the AWFC.
but since the page1 was validated and the page2 was shown, because of this there is call to the showPage(request, errors, targetPage) at line number 513.
as a result a session attribute is set in the showPage method at line number request.getSession().setAttribute(pageAttrName, pageInteger); 341.
Now back to the scenario.
page1 is submitted, the targetPage is 1 as a result the session has the attribute pageAttrName as 1. the page2 is shown as a result of the page1 submission which is normal.
now when the user refreshes the page2(resubmits the page1 post request). the validatePage is called from the processFormSubmission and the page2 gets validated which shouldnot happen,
Iam assuming that the fix to this would be to add an additional check in the if construct of the AWFC line 494,
Code:
// Normal submit: validate current page and show specified target page.
// determine the targetPage by calling the getTargetPage() method and add the following .
if (targetPage != currentPage && !suppressValidation(request, command, errors)) {
if (logger.isDebugEnabled()) {
logger.debug("Validating wizard page " + currentPage + " for form bean '" + getCommandName() + "'");
}
validatePage(command, errors, currentPage, false);
}
.
This should handle the refreshes without calling validate.
Kindly let me know if this is correct. |
Show » |
|
The solution for your scenario is to explicitly specify the "_page" parameter (see PARAM_PAGE in the javadoc) on each of your pages, typically as a hidden form field, indicating the submitting page. With this in place, a browser refresh or usage of the back button will still result in correct submission behavior. Please give this a try...
Juergen