Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
Difference between revisions of "Jetty/Reference/jetty-web.xml"
(New page: {{Jetty Reference | introduction = <tt>jetty-web.xml</tt> is a Jetty configuration file which can be bundled with a specific web application. The format of <tt>jetty-web.xml</tt> is the sa...) |
m |
||
Line 18: | Line 18: | ||
</source> | </source> | ||
− | {{warn|Make sure you are applying the configuration to an | + | {{warn|Make sure you are applying the configuration to an instance of the proper class. <tt>jetty-web.xml</tt> configures an instance of WebAppContext; <tt>jetty.xml</tt> configures an instance of Server.}} |
== Using <tt>jetty-web.xml</tt> == | == Using <tt>jetty-web.xml</tt> == |
Revision as of 01:52, 25 June 2009
Introduction
jetty-web.xml is a Jetty configuration file which can be bundled with a specific web application. The format of jetty-web.xml is the same as jetty.xml -- it is an XML mapping of the Jetty API.
This document offers an overview for using the jetty-web.xml configuration file. For a more in-depth look at the syntax, see Syntax Reference.
Root Element
jetty-web.xml
<?xml version="1.0" encoding="ISO-8859-1"?> <!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "http://www.eclipse.org/jetty/configure.dtd"> <Configure class="org.eclipse.jetty.webapp.WebAppContext"> .. </Configure>
Make sure you are applying the configuration to an instance of the proper class. jetty-web.xml configures an instance of WebAppContext; jetty.xml configures an instance of Server.
Using jetty-web.xml
Place the jetty-web.xml into your web application's WEB-INF folder. When Jetty deploys a web application, it looks for a file called WEB-INF/jetty-web.xml or WEB-INF/web-jetty.xml within the web application (or WAR) and applies the configuration found there. jetty-web.ml is called after all other configuration has been applied to the web application.
Example Files
The distribution contains an example of jetty-web.xml inside the WEB-INF folder of the test webapp war ($JETTY_HOME/webapps/test.war/WEB-INF/jetty-web.xml).
Additional Resources
- Syntax Reference - in-depth reference for Jetty-specific configuration XML syntax
- jetty.xml - configuration file for configuring the entire server