简体   繁体   中英

How Struts2 prevents form resubmission on page refresh with use of “Redirect”

I have done a lot of search on "How to prevent duplicate form submission on page reload" for struts 1.3 framework.

Meanwhile I came across the information that struts2 uses a dispatch type which is "Redirect" and which is inbuilt functionality for preventing duplicate form submission on page reload.

I want to know the function in detail. If someone could please explain me what is the internal processing behind "Redirect" dispatch type and how does struts2 detect and prevent the form resubmission.

struts2 and struts1 all have function preventing duplicate submission. it is called "dynamic token"

for struts2 use <s:token name="user.token"></s:token> in your jsp.

and < result name ="invalid.token" type ="dispatcher"> /jsp/repeatRefresh.jsp </ result > this is the invalid token result mapping.

more information you may refer to google.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM