Prevent resubmit a form and struts -
i have 2 jsp page: page1.jsp form , page2.jsp displays message tell user if record insert happened or not.
if form submitted , user refreshes page2, insert happens.
i wouldn't use session variable, , setting request attribute in page2 doesn't resolve issue (it seems not work).
you can give try this:
from
page1.jsp
set request attribute, when control reachespage2.jsp
check request attribute if there redirect control same page2.jsp. in way when control redirected same or other resource, previous request , response objects no more there(i.e. both request , response object destroy because http stateless protocol) , after redirection there no data related previous request , on refreshing page2.jsp not repeat previous task.
i not sure in 1 of application used same purpose. let me know if has better alternative.
Comments
Post a Comment