Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "Jetty WTP Plugin/Jetty WTP Create Server"

(Creating a Jetty Server)
 
(34 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{Jetty Reference
+
{{Jetty}}
  
=== Creating the Jetty Server ===
+
==Creating a Jetty Server ==
  
|body =
+
To create a Jetty Server entry, complete the following steps.
 +
<ol>
 +
<li>From the main Eclipse window, select '''File -> New -> Other'''. The ''Select a Wizard'' dialog box opens.
 +
</li>
  
== Step 1 ==
 
  
To create a WTP Jetty/Server, go at File/New/Other... and select Server node :
+
</li>[[Image:Jetty-wtp-create1.jpg]]
  
[[Image:Jetty-wtp-create1.jpg]]
 
  
== Step 2 ==
 
Click on Next button. You can use Jetty7x or Jetty 8x. In this documentation we will use Jetty 7.0 Server :
 
  
[[Image:Jetty-wtp-create2.jpg]]
+
<li>In the ''Wizards'' list box, scroll down to select '''Server -> Server'''.
 +
<li>Click '''Next'''. The ''Define a New Server'' dialog box opens.
 +
</li>
  
== Step 3 ==
 
Click on Next button, now you must specify the installation directory for Jetty. Use Browse button to do that OR click on Download and Install... button to download the Jetty v7. In this documentation, we will do that. :
 
  
[[Image:Jetty-wtp-create3.jpg]]
+
</li>[[Image:Jetty-wtp-create2.jpg]]
  
== Step 4 ==
 
Click on Download and Install... the dialog opens :
 
  
[[Image:Jetty-wtp-create4.jpg]]
+
<li>In the ''Select the server type'' field, scroll down to select '''Jetty -> Jetty 7.x''' or '''Jetty 8.x Server'''. This document uses the Jetty 7.x Server.
 +
<li>Click '''Next'''. The ''Jetty Server'' dialog box opens.
 +
</li>
  
== Step 5 ==
 
  
Accept the license and click on Finish button. Select the base directory where you wish install the Jetty. In my case I have selected D:\Servers\jetty-distribution-7.1.6.v20100715 and the download will set stable  Jetty v7 server in this folder.
 
  
[[Image:Jetty-wtp-create5.jpg]]
+
</li>[[Image:Jetty-wtp-create3.jpg]]
  
Once you have selected a folder, download is processed. You have an error because the wizard check that start.jar exist in the D:\Server\jetty-distribution-7.1.6.v20100715 (this JAR doesn't exist because the download  is not finished).
 
  
In my case, download is slowly. Wait for enabling Finish button. Once Download is finished, Finish button is enable 
+
<li>To specify the installation directory for Jetty, use the '''Browse''' button. Navigate to a local installation of jetty7 or jetty8 and click select.
 +
</li>
  
== Step 6 ==
 
  
Once download is finished, you will have  D:\Server\jetty-distribution-7.1.6.v20100715 which contains start.jar...from the Jetty7 :
+
<li>Click '''Next'''. The ''Add and Remove'' dialog boxopens.  
 +
</li>
  
[[Image:Jetty-wtp-create6.jpg]]
 
  
== Step 7 ==
 
Click on Next button, here you can select existing Dynamic Web project from your workspace. In this documentation, teher are not WTP Dynamic WebProject.
 
  
[[Image:Jetty-wtp-create7.jpg]]
+
</li>[[Image:Jetty-wtp-create7.jpg]]
  
  
== Step 8 ==
+
Here you can select an existing Dynamic Web project from your workspace. In this example, there are no WTP Dynamic WebProjects.
 +
 
 +
 
 +
 
 +
<li>Click '''Finish'''.
 +
</ol>
 +
 
 +
 
 +
* A Server Project is created in the workspace.
 +
* if you go to WTP Server View , you see the option to launch Jetty v7.0 Server at localhost, which you can use to start/stop/debug the installed Jetty server.
  
Click on Finish button :
 
  
* A Server Project is created in the workspace
 
* if you go at WTP Server View , you will see the launch Jetty v7.0 Server at localhost that you can use to start/stop/debug the Jetty install server.
 
  
 
[[Image:Jetty-wtp-create8.jpg]]
 
[[Image:Jetty-wtp-create8.jpg]]
  
Servers contains the Jetty v7.0 Server at localhost-config folder which contains :  
+
 
* start.ini coming from the Jetty install (D:\Servers\jetty-distribution-7.1.6.v20100715)
+
 
* start.config : coming from the JAR start.jar  from the Jetty install. You can notice Server/start.config is not the same than Jetty install/start.jar. Jetty Home is not the Jetty Install server but a WTP folder (created in the .metdata of your workspace). When Jetty server is called it use :
+
The Servers folder includes the Jetty v7.0 Server at localhost-config folder, which contains:  
** -Djetty.home : which is the WTP folder.
+
* <tt>start.ini</tt> from the Jetty install (D:\Servers\jetty-distribution-7.2.x).
** -Dinstall.jetty.home : which is the Jetty install folder.
+
* <tt>start.config</tt> from the JAR <tt>start.jar</tt> from the Jetty install. Notice that <tt>Server/start.config</tt> is not the same as Jetty <tt>install/start.jar</tt>. Jetty Home is not the Jetty Install server but a WTP folder (created in the .metadata of your workspace).  
* the jetty*.xml files which are declared in the original start.ini. Jetty*.xml files are preprocessed too to transform <Property to <SystemProperty.
+
* the <tt>jetty*.xml</tt> files, which are declared in the original <tt>start.ini. Jetty*.xml</tt> files are preprocessed too to transform <Property to <SystemProperty.
* webdefault.xml is modified to avoid locking HTML files (when sJetty is started and HTML files are modified (published) with the option :
+
* <tt>webdefault.xml</tt> is modified to avoid locking HTML files under Windows when Jetty is started and HTML files are modified (published) with the following option:
 +
 
  
 
<source lang="xml">
 
<source lang="xml">
                        <init-param>
+
  <init-param>
              <param-name>useFileMappedBuffer</param-name>
+
    <param-name>useFileMappedBuffer</param-name>
<param-value>false</param-value>
+
    <param-value>false</param-value>
    </init-param>
+
  </init-param>
 
</source>
 
</source>
  
}}
+
When the Jetty server is called it uses:
 +
* <tt>-Djetty.home</tt>, which is the WTP folder.
 +
* <tt>-Dinstall.jetty.home</tt>, which is the Jetty install folder.

Latest revision as of 14:46, 22 December 2010



Creating a Jetty Server

To create a Jetty Server entry, complete the following steps.

  1. From the main Eclipse window, select File -> New -> Other. The Select a Wizard dialog box opens.

  2. Jetty-wtp-create1.jpg


  3. In the Wizards list box, scroll down to select Server -> Server.
  4. Click Next. The Define a New Server dialog box opens.

  5. Jetty-wtp-create2.jpg


  6. In the Select the server type field, scroll down to select Jetty -> Jetty 7.x or Jetty 8.x Server. This document uses the Jetty 7.x Server.
  7. Click Next. The Jetty Server dialog box opens.

  8. Jetty-wtp-create3.jpg


  9. To specify the installation directory for Jetty, use the Browse button. Navigate to a local installation of jetty7 or jetty8 and click select.

  10. Click Next. The Add and Remove dialog boxopens.

  11. Jetty-wtp-create7.jpg


    Here you can select an existing Dynamic Web project from your workspace. In this example, there are no WTP Dynamic WebProjects.


  12. Click Finish.


  • A Server Project is created in the workspace.
  • if you go to WTP Server View , you see the option to launch Jetty v7.0 Server at localhost, which you can use to start/stop/debug the installed Jetty server.


Jetty-wtp-create8.jpg


The Servers folder includes the Jetty v7.0 Server at localhost-config folder, which contains:

  • start.ini from the Jetty install (D:\Servers\jetty-distribution-7.2.x).
  • start.config from the JAR start.jar from the Jetty install. Notice that Server/start.config is not the same as Jetty install/start.jar. Jetty Home is not the Jetty Install server but a WTP folder (created in the .metadata of your workspace).
  • the jetty*.xml files, which are declared in the original start.ini. Jetty*.xml files are preprocessed too to transform <Property to <SystemProperty.
  • webdefault.xml is modified to avoid locking HTML files under Windows when Jetty is started and HTML files are modified (published) with the following option:


  <init-param>
    <param-name>useFileMappedBuffer</param-name>
    <param-value>false</param-value>
  </init-param>

When the Jetty server is called it uses:

  • -Djetty.home, which is the WTP folder.
  • -Dinstall.jetty.home, which is the Jetty install folder.

Back to the top