This discussion is archived
2 Replies Latest reply: Nov 16, 2011 7:59 AM by 796440 RSS

Thread Safe Servlet

898516 Newbie
Currently Being Moderated
How to write thread safe programme in servlet.

  • 1. Re: Thread Safe Servlet
    gimbal2 Guru
    Currently Being Moderated
    You don't write programs in servlets. Servlets may be components in a web application though.

    What you perhaps want is a good book. I suggest you give a read, not only because it is free but also because it is very good. Whatever you do, you are not going to learn this by asking questions in a forum.
  • 2. Re: Thread Safe Servlet
    796440 Guru
    Currently Being Moderated
    If you're asking how to make your servlet threadsafe, then:

    1) Making sure the Servlet itself has no member variables is one step. That will make that class threadsafe.

    2) Of course, your servlet might still me unsafely using other classes. For that, you make it threadsafe just like you do any other code.


  • Correct Answers - 10 points
  • Helpful Answers - 5 points