CSRF prevention for AJAX call from extjs to Struts action [closed]
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 3 years ago . I need to implement CSRF attack prevention using token in application that uses ajax post requests (ExtJs library) to Struts actions. How can I implement token generation and validation in such case? 回答1: In ExtJS you can use this: Ext.Ajax.setDefaultHeaders({ token: 'xyz' }) This