aspose file tools*
The moose likes Struts and the fly likes Thread safe and servlets (Action servlet) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Thread safe and servlets (Action servlet)" Watch "Thread safe and servlets (Action servlet)" New topic
Author

Thread safe and servlets (Action servlet)

Timothy Toe
Ranch Hand

Joined: Oct 19, 2002
Posts: 156
I have my own Action classes that extend
org.apache.struts.action.Action
I understand that the Action class is a Servlet.
Is it compulsory that all Servlets (Action class in this context) be thread-safe ?
When multiple requests from multiple browsers hit the app server, the container will instantiate 1 servlet for each request right ? (and not many clients share 1 servlets - multi threads running 1 servlet, right ?)
If it is always 1 servlet for each request (single thread running a servlet at any one time), then it it is ok even if the action class is not thread-safe ?

Thanks.
Timothy Toe
Ranch Hand

Joined: Oct 19, 2002
Posts: 156
Ooppss... I think I cause confusion for my question.
What I was talking was the Action class and not Action servlet.

Hope this clarifies.
Thanks.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Thread safe and servlets (Action servlet)