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/Reference/jetty-web.xml"

m
 
(9 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 
{{Jetty Reference
 
{{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 same as <tt>[[Jetty/References/jetty.xml|jetty.xml]]</tt> -- it is an XML mapping of the Jetty API.
+
| introduction =  
  
This document offers an overview for using the <tt>jetty-web.xml</tt> configuration file. For a more in-depth look at the syntax, see [[Jetty/References/Syntax Reference|Syntax Reference]].  
+
{{Jetty Redirect|http://www.eclipse.org/jetty/documentation/current/jetty-web-xml-config.html}}
 +
 
 +
<tt>jetty-web.xml</tt> is a Jetty configuration file that you can bundle with a specific web application. The format of <tt>jetty-web.xml</tt> is the same as <tt>[[Jetty/Reference/jetty.xml|jetty.xml]]</tt> -- it is an XML mapping of the Jetty API.
 +
 
 +
This document offers an overview for using the <tt>jetty-web.xml</tt> configuration file. For a more in-depth look at the syntax, see [[Jetty/Reference/jetty.xml Syntax|jetty.xml Syntax Reference]].  
  
 
| body =  
 
| body =  
  
 
== Root Element ==
 
== Root Element ==
<tt>jetty-web.xml</tt> is applied on a per-webapp basis, and configures an instance of org.eclipse.jetty.webapp.WebAppContext.
+
<tt>jetty-web.xml</tt> applies on a per-webapp basis, and configures an instance of <tt>org.eclipse.jetty.webapp.WebAppContext</tt>.
  
 
<source lang="xml">
 
<source lang="xml">
 
<?xml version="1.0"  encoding="ISO-8859-1"?>
 
<?xml version="1.0"  encoding="ISO-8859-1"?>
<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "http://www.eclipse.org/jetty/configure.dtd">
+
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure.dtd">
  
 
<Configure class="org.eclipse.jetty.webapp.WebAppContext">
 
<Configure class="org.eclipse.jetty.webapp.WebAppContext">
Line 18: Line 22:
 
</source>
 
</source>
  
{{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.}}
+
{{caution|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> ==
  
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 <tt>WEB-INF/jetty-web.xml</tt> or <tt>WEB-INF/web-jetty.xml</tt> within the web application (or WAR) and applies the configuration found there. <tt>jetty-web.ml</tt> is called ''after'' all other configuration has been applied to the web application.
+
Place the <tt>jetty-web.xml</tt> into your web application's <tt>WEB-INF</tt> folder. When Jetty deploys a web application, it looks for a file called <tt>WEB-INF/jetty-web.xml</tt> or <tt>WEB-INF/web-jetty.xml</tt> within the web application (or WAR) and applies the configuration found there. Be aware that <tt>jetty-web.xml</tt> is called ''after'' all other configuration has been applied to the web application.
  
== Example Files ==  
+
== Examples ==  
  
 
The distribution contains an example of <tt>jetty-web.xml</tt> inside the WEB-INF folder of the test webapp war (<tt>$JETTY_HOME/webapps/test.war/WEB-INF/jetty-web.xml</tt>).
 
The distribution contains an example of <tt>jetty-web.xml</tt> inside the WEB-INF folder of the test webapp war (<tt>$JETTY_HOME/webapps/test.war/WEB-INF/jetty-web.xml</tt>).
Line 30: Line 34:
  
 
| more =  
 
| more =  
* [[Jetty/References/Syntax Reference|Syntax Reference]] - in-depth reference for Jetty-specific configuration XML syntax
+
* [[Jetty/Reference/jetty.xml syntax|jetty.xml Syntax Reference]] - in-depth reference for Jetty-specific configuration XML syntax
* [[Jetty/References/jetty.xml|jetty.xml]] - configuration file for configuring the entire server
+
* [[Jetty/Reference/jetty.xml|jetty.xml]] - configuration file for configuring the entire server
  
 
}}
 
}}

Latest revision as of 15:42, 23 April 2013



Introduction

Warning2.png
Jetty 7 and Jetty 8 are now EOL (End of Life)




THIS IS NOT THE DOCUMENTATION YOU ARE LOOKING FOR!!!!!






All development and stable releases are being performed with Jetty 9 and Jetty 10.






This wiki is now officially out of date and all content has been moved to the Jetty Documentation Hub






Direct Link to updated documentation: http://www.eclipse.org/jetty/documentation/current/jetty-web-xml-config.html


jetty-web.xml is a Jetty configuration file that you can bundle 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 jetty.xml Syntax Reference.

Root Element

jetty-web.xml applies on a per-webapp basis, and configures an instance of org.eclipse.jetty.webapp.WebAppContext.

<?xml version="1.0"  encoding="ISO-8859-1"?>
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure.dtd">
 
<Configure class="org.eclipse.jetty.webapp.WebAppContext">
 ..
</Configure>
Stop.png
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. Be aware that jetty-web.xml is called after all other configuration has been applied to the web application.

Examples

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

Back to the top