views:

153

answers:

2

Hello,

Could anyone please tell me, what the meaning of the word "Deploy" and "Redeploy" in context of Tomcat in the following line:

ServletConfig parameters won't change for as long as this servlet is deployed an running. To change them, you'll have to redeploy the servlet

Thanks very much in advance.

A: 

This means that if your server is deployed and running (i.e. working) then your changes will not show up until you redeploy (i.e. stop the server and deploy the code and start again).

Jesse
+1  A: 

When it says "deployed" that means Tomcat read the Servlet definition (usually a web.xml inside a war) and started the Servlet, which is now available for use. This is when ServletConfig parameters are passed to the Servlet.

When it says "redeploy", it means any way you force it to re-read the Servlet definition (which will re-read the ServletConfig parameters).

The easiest way to redeploy a Servlet is to stop Tomcat and start it again. When Tomcat stops, it undeploys everything that was deployed. When Tomcat starts, it deploys everything again.

Restarting the server may be overkill for you if all you want is to have one Servlet re-read its configuration. A faster way (in server time, not necessarily the time it takes you to figure out how to do it) to redeploy a Servlet is called hot deploy. Hot deploying is when you redeploy a Servlet when Tomcat is still running. See the Tomcat documentation for more info on how to do it in Tomcat.

joe p