Exporting, importing and deploying a Dynamic Web Project on a Tomcat server
In this tutorial, we will see how to export, import and deploy a Dynamic Web Project (such as your created Servlet, JSP projects) on a Tomcat server. We will deploy the servlet-jsp project created in the previous tutorial.
Exporting the project
Right click on the
servlet-jsp project, select
Export→WAR file.
Select a destination including a
[file name].war, for example
[your Desktop]/servlet-jsp.war.
Importing the project
Right click on the project explorer, select
Import→WAR file.
Select the
war file needed to import and give a
name for the created project. Click on
Finish.
Deploying the project on a Tomcat server
Copy the servlet-jsp.war file to [your Tomcat]/webapps folder.
Stop the Tomcat integrated in Eclipse.
Start your Tomcat server by executing the startup.sh (or startup.bat if you are using Windows) in [your Tomcat]/bin folder.
-
Exercises
Export your servletlabs and jsplabs projects and deploy them on your Tomcat server. Verify whether they are running.
Stop your Tomcat. Then, open [your tomcat]/conf/server.xml. Change the paramter: port=“8080” to port=“8081”. Now, start your Tomcat and verify whether they are running.
Ask your friend about the IP address of her/his PC. Then, attempt to access to servlets and jsp files which are running on your friend's PC.
Back to top