struts action singleton

前端 未结 3 875
轮回少年
轮回少年 2020-12-14 13:43

Why is the struts action class is singleton ?

Actually I am getting point that it is multithreaded. but at time when thousand of request hitting same action, and we

3条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-14 14:14

    This has changed in Struts2 http://struts.apache.org/release/2.1.x/docs/comparing-struts-1-and-2.html

    *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.) *

提交回复
热议问题