Struts2 is thread-safe. By default, an instance object is created for each request, which solves the thread security problem caused by servlet to a certain extent. After the Struts2 Bean is handed over to Spring IOC for management, it uses a singleton by default. All requests use the same Action. When the Action defines some variables to accept parameters or performs verification, thread security issues often occur. For example, the Action of Struts2 is a singleton. The error information in FieldError and actionerror is accumulated, and verification cannot be performed even if the correct information is entered again. Action defines the User object, request A to submit the form, fill in the User object, and request B to determine whether the User object in the Action is empty, if it is not null, load (at this time, the User object corresponding to the B request is not loaded) and so on .... so when integrating Struts2 in Spring, remember to set the Scope of Struts2 Bean to prototype [java] @ Controller @ Scope (BeanDefinition. SCOPE_PROTOTYPE) public class UserAction extends ActionSupport {