Hi ,
I have been trying to disable duplicate form submission in the application that I am working on. I followed the JavaDoc on AbstractFormController.handleInvalidSubmit() and had the method handleInvalidSubmit() overridden in the subclass to return to an error page.
Also the form used for this controller is a session form. However after submitting the form, I can still resubmit it by going back and clicking submit.
I thought all I needed to do was override the handleInvalidSubmit() method in the subclass and have the form as sessionForm. Pls also note that I have not overridden formBackingObject(), hence it never returns a preinitialized backing object (but should this matter ?).
When I tried to debug, I notice that handleInvalidSubmit() never gets called. So I guess in AbstractFormController.handleRequestInternal(),
if (isSessionForm() && request.getSession().getAttribute(getFormSessionAt tributeName()) == null) {
// cannot submit a session form if no form object is in the session
return handleInvalidSubmit(request, response);
}
the condition is never true.
Could someone please help me out ?
Thanks a lot in advance.
Arun chalise


Reply With Quote