I am very confused about what is deployment?
Suppose we are using Tomcat.
1. Suppose Tomcat is NOT running .When we write a jsp and put it in root of the application or put a servlet class file in WEB-INF/classes can we say that we have deployed the jsp and servlet OR do the jsp and the servlet get deployed after Tomcat STARTS running.
2. When we restart Tomcat ( or any other Container) is everything redeployed ?
Deployment is about copying your .war file into the correct deployment-directory of your container (e.g. tomcat $CATALINA_HOME/webapps)
When tomcat is starting up it will startup/activate your wep-application.
When we restart Tomcat ( or any other Container) is everything redeployed ?
Yes, but you can even copy a new .war file on the deployment dir while tomcat is running and tomcat will uninstall the old version and install the new version.
have a look at the description tomcat gives:
Frits Walraven wrote:Deployment is about copying your .war file into the correct deployment-directory of your containe
Why do we need a new term "deployment", if the deployment is just "about copying"? This link http://en.wikipedia.org/wiki/Software_deployment have some insights on deployment.
Normally for the sake of simplicity the developer just bundles the whole web-application into a .war file which could be copied to the webapps in TOMCAT. I hope you got it.
Gaurav Sagar wrote:Deployment is a lot different from the development, its from the application users point of view. It means a standard structure where to put what things, such as .class files in the yourapplication/WEB-INF/classes/ directory, similarly the .jar files in the yourapplication/WEB-INF/lib/ directory. Now this means that all the class files in the classes directory and the jar in the lib directory are set up in the classpath..
Do application users really care about standard structure of the application or how do you put the files together?
So Frits it means when you copy the files in appropriate directories they get deployed .
When Tomcat starts the appl is activated.
There comes a lot more to deployment then only installing and activating, but basically that is as much as you need to know for the exam. The specifications tell you more about the required directory structure before you can do deployment and that is important for the exam. Have a good look at the following Servlet 2.4 specification section:
SRV.9.4 Deployment Hierarchies