简体   繁体   中英

How Token Interceptor work in Struts 2

Struts2 provide Token Interceptor for ensures that only one request per token is processed, But, I don't understand how it works, if a user send the one request twice what happens? Does the user get an invalid token or get response of the first request? What is a logic behind this interceptor?

The token interceptor returns the result invalid.token when an invalid token is found. The logic is simple: it uses a session to save a valid token per request and when intercept it checks it by comparing one that sent and other that is from session.

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