HttpServlet does not implement runnable or extend thread, why is it thread-able?
问题 For an object to be runnable, it needs to implement the Runnable interface or extend the Thread class, however, it does not seem that HttpServlet does any of these. How come HttpServlet can be threaded or have i mistaken? 回答1: The Servlet itself is not a thread. The container maintains one instance of the servlet class and each request (thread) calls the same servlet object. So the servlet instances is shared across threads. In pseudo code it may look like this: class ServerThread extends