life cycle of servlet

Servlets are normal Java classes which are created when needed and destroyed when not needed. Since Servlets run within a Servlet Container, creation and destruction of Servlets is the duty of Servlet Container and not yours. Implementing the init() and destory() methods of Servlet interface allows you to be told by the Servlet Container that when it has created an instance of your Servlet and when it has destroyed that instance. An important point to remember is that your Servlet is not created and destroyed for every request it receives, rather it is created and kept in memory where requests are forwarded to it and your Servlet then generates response.



Examining Java Servlets in detail. Servlet life cycle, HttpServlet class, ServletConfig and ServletContext Objectsより




要はコンテイナーによって全て管理されている、ということです。



わかっていても、うまく答えられないことが多々ある。

英語を言い訳にはしたくない。

自分の知ってることはちゃんと答えられるようになりたい。

ぼんやりとした理解やなんとなくわかってる、では

上手く説明できなかったり上手く伝わらなかったりするから、

こうしてテキストブックアンサーを見ることで、

どうやってポイントを押さえてわかりやすく説明するかを理解して、

少しずつ自分のものにできたらなぁ、と思ってる。