Skip to main content
Jump to: navigation, search

Jetty WTP Plugin/Jetty WTP Dynamic Web Project

< Jetty WTP Plugin
Revision as of 16:10, 17 November 2010 by (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Dynamic Web Project

Step 1

To create a Dynamic WTP Project, go at File/New/Other... and select Web/Dynamic Web Project node :


Step 2


Step 3

Click on Finish button, The WTP Dynamic Web Project is created and you can use JAR from the Jetty install with the Jetty v7.0 library which was created :


Step 4

Create WebContent/index.htm like this :

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "">
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>My first WEB Application</title>
	My first WEB Application.


Step 5

Drag and drop the project mywebapp to the launch Jetty v7.0 Server at localhost-config :


Step 6

You can start/stop the Jetty server :


Step 7

You can start the Jetty server, you will see in the console some Jetty logs :


2010-10-01 08:34:09.390:INFO::jetty-7.1.6.v20100715
2010-10-01 08:34:09.421:INFO::Deployment monitor D:\_Projets\Personal\runtime-EclipseApplication-Jetty-Demo\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\contexts at interval 5
2010-10-01 08:34:09.421:INFO::Deployable added: D:\_Projets\Personal\runtime-EclipseApplication-Jetty-Demo\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\contexts\mywebapp.xml
2010-10-01 08:34:09.734:INFO::Deployment monitor D:\_Projets\Personal\runtime-EclipseApplication-Jetty-Demo\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\webapps at interval 5
2010-10-01 08:34:09.765:INFO::Started SelectChannelConnector@

You can notice that:

  • Jetty deploy mywebapp by using file mywebapp.xml (which configure org.eclipse.jetty.webapp.WebAppContext and it is generated with the WTP Jetty Adaptor).
  • mywebapp.xml is stored in YOUR_WORKSPACE/.metadata\.plugins\org.eclipse.wst.server.core\tmp0\contextsfolder (your metdata). When you modify the file YOUR_WORKSPACE /mywebapp/index.htm (from your Eclipse project), the WTP Adaptor publish it to the OUR_WORKSPACE/.metadata\.plugins\org.eclipse.wst.server.core\tmp0/wtpwebapps\mywebapp folder.
  • Port used is 8080. If you wish modify the port, please read how to modify the port.

Step 8

Go at http://localhost:8080/mywebapp/


You will see the index.htm content. You can also create a Servlet and debug it.

Back to the top