Reputation: 2296
Can anyone explain, if Struts Action classes are threadsafe in Struts 1.x.
Upvotes: 2
Views: 1765
Reputation: 51030
It caches the instance of an Action class and reuses it for subsequent requests.
You can check out the code here: org.apache.struts.action.RequestProcessor.process(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException
So, they are not thread-safe.
Upvotes: 1
Reputation: 42040
In fact, Struts 1.x is stateless. But if you include instance variables in your Action's not anymore (Not recomended), because the same instance is used. You can see the behavior of Struts 1.x if you enable the log level to TRACE.
Upvotes: 1