• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Neil: Specification and Struts

 
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Neil,
Sun's servlet specifications states that it is best avoided to pass the request, response
to another thread of execution.. as they are not gauranteed to be thread safe.
to quote..
"
2.3.3.3
A Developer should note that implementations of the request and response objects are not
guaranteed to be thread safe. This means that they should only be used in the scope of the
request handling thread. References to the request and response objects should not be given
to objects executing in other threads as the behavior may be nondeterministic.
"
Is the Action Servlets behaviour to pass the request, response to the Action class any cause of concern.
Please shed more light on this in the context of the specification
 
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Interesting question..
But I think that though an ActionServlet passes the request and reponse objects to an Action class, it does not start a new or a separate thread for it. The ActionServlet itself might be executing in a separate thread for a fresh request, as is true with all servlets, but it does not spawn any new threads when it delegates to the Action classes.
Rgds,
Anupreet Arora
 
Pravin Panicker
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
okk Thanks.. I guess the behaviour of Action Servlet's service would be

void service(){
1. Load the action class from config
2. Pass the parameters and call its action method
}

So it all happens in the same thread There is a containment relationship between the Action Servlet and the Actionclass
guess i was plain confused.. Thanks a lot
 
Author
Posts: 82
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, this is correct -- the Action is invoked in the thread spawned for the user from the ActionServlet.
 
reply
    Bookmark Topic Watch Topic
  • New Topic