• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Junilu Lacar
  • Martin Vashko
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Scott Selikoff
  • salvin francis
  • Piet Souris

Thread safe and servlets (Action servlet)

 
Ranch Hand
Posts: 156
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 156
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
What a show! What atmosphere! What fun! What a tiny ad!
Sauce Labs - World's Largest Continuous Testing Cloud for Websites and Mobile Apps
https://coderanch.com/t/722574/Sauce-Labs-World-Largest-Continuous
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!