- 論壇徽章:
- 0
|
RT
在DOC看到他們兩的區(qū)分,但并沒有找到為什么這么做,還請(qǐng)大蝦指點(diǎn)指點(diǎn)
Threading Model
Struts 1 Actions are singletons and must be thread-safe since there will only be one instance of a class to handle all requests for that Action. The singleton strategy places restrictions on what can be done with Struts 1 Actions and requires extra care to develop. Action resources must be thread-safe or synchronized.
Struts 2 Action objects are instantiated for each request, so there are no thread-safety issues. (In practice, servlet containers generate many throw-away objects per request, and one more object does not impose a performance penalty or impact garbage collection.) |
|