I write couples of servlet program, however I dont think I fully understand how servlet run. So here is couples question that I have:
All the code I wrote about Servlet only run on Netbeans with apache tomcat run behind. When I run my html file that make request to the servlet, it usually give error saying that it could not find the servlet, I then have to redeploy the servlet then everything would run fine. Seem like my servlet timeout after a while or something.
Does the servlet run all the time? Servlet has init() and destroy(), so I guess it wont run all the time. So then when does it start and when does it end? Does it start when there is a request from the client, and end when it is time out? And how does I fixed my problem that I have to constantly redeploy the servlet. Thank you very much.