How to solve the linear security problem of servlet?

servlet defaults to single-instance multithreading mode, so linear security problems may occur. One solution is to implement the SingleThreadModel interface, but this method is not recommended. It is said that this method consumes a lot of memory resources when the concurrency is high. (because the implementation of this interface, that is, each request, will create a servlet instance, which is multiple instances, which will take up a lot of memory),. But isn"t it the default in struts2 to create an action for every request? why doesn"t anyone say that struts2 consumes a lot of memory resources?

Mar.28,2021

the thread safety problem is that there is a shared state, as long as the servlet member variables are not shared, or as long as the member variables are set for the correct Synchronize, there is no thread safety problem.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3c2d1-2c2e5.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3c2d1-2c2e5.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?