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

  1. Right click on the servlet-jsp project, select Export→WAR file.


  2. Select a destination including a [file name].war, for example [your Desktop]/servlet-jsp.war.


Importing the project

  1. Right click on the project explorer, select Import→WAR file.


  2. 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

  1. Copy the servlet-jsp.war file to [your Tomcat]/webapps folder.
  2. Stop the Tomcat integrated in Eclipse.
  3. Start your Tomcat server by executing the startup.sh (or startup.bat if you are using Windows) in [your Tomcat]/bin folder.
  4. Now, your application is running at: http://localhost:8080/servlet-jsp/

Exercises

  1. Export your servletlabs and jsplabs projects and deploy them on your Tomcat server. Verify whether they are running.
  2. 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.
  3. 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.
teaching_assistant/servlet-jsp/tomcat.txt · Last modified: 2013/07/08 08:44 (external edit)
Back to top
CC Attribution-Share Alike 4.0 International
chimeric.de = chi`s home Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0