Jump to: navigation, search

Difference between revisions of "Jetty/Reference/jetty-env.xml"

m
m
Line 1: Line 1:
 
{{Jetty Reference
 
{{Jetty Reference
 
| introduction = <tt>jetty-env.xml</tt> is an optional Jetty configuration file that you can place in your webapp's WEB-INF directory to configure JNDI resources specifically for that webapp. 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.
 
| introduction = <tt>jetty-env.xml</tt> is an optional Jetty configuration file that you can place in your webapp's WEB-INF directory to configure JNDI resources specifically for that webapp. 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-env.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 =  
At startup, Jetty will automatically look for a file of this name in the webapp's WEB-INF directory, and set up the webapp's naming environment so that naming references in the <tt>WEB-INF/web.xml</tt> file can be resolved from the information in the <tt>WEB-INF/jetty-env.xml</tt> file (along with any global naming resources defined in a <tt>jetty.xml</tt> startup file.
+
When Jetty deploys a web application, it automatically looks for a file called <tt>WEB-INF/jetty-env.xml</tt> within the web application (or WAR), and sets up the webapp naming environment so that naming references in the <tt>WEB-INF/web.xml</tt> file can be resolved from the information provided in the <tt>WEB-INF/jetty-env.xml</tt> and [[Jetty/Reference/jetty.xml|jetty.xml]] files.
 +
note|You define global naming resources on the server via <tt>jetty.xml</tt>.
  
 
== Root Element ==
 
== Root Element ==
<tt>jetty-env.xml</tt> is applied on a per-webapp basis, and configures an instance of org.eclipse.jetty.webapp.WebAppContext.
+
Jetty applies <tt>jetty-env.xml</tt> on a per-webapp basis, and configures an instance of org.eclipse.jetty.webapp.WebAppContext.  
 
+
 
<source lang="xml">
 
<source lang="xml">
 
<?xml version="1.0"  encoding="ISO-8859-1"?>
 
<?xml version="1.0"  encoding="ISO-8859-1"?>
Line 23: Line 21:
 
== Using <tt>jetty-env.xml</tt> ==
 
== Using <tt>jetty-env.xml</tt> ==
  
Place the <tt>jetty-env.xml</tt> file into your web application's WEB-INF folder. When Jetty deploys a web application, it automatically looks for a file called <tt>WEB-INF/jetty-env.xml</tt> within the web application (or WAR), and sets up the webapp naming environment so that naming references in the <tt>WEB-INF/web.xml</tt> file can be resolved from the information provided in the <tt>WEB-INF/jetty-env.xml</tt> and [[Jetty/Reference/jetty.xml|jetty.xml]] files.
+
Place the <tt>jetty-env.xml</tt> file in your web application's WEB-INF folder.  
 
+
<tt>jetty-env.xml</tt> files contain configuration specific to a webapp. Global naming resources should be defined on the server via <tt>jetty.xml</tt>.
+
  
 
== Example ==
 
== Example ==

Revision as of 13:06, 20 August 2010



Introduction

jetty-env.xml is an optional Jetty configuration file that you can place in your webapp's WEB-INF directory to configure JNDI resources specifically for that webapp. The format of jetty-web.xml is the same as jetty.xml -- it is an XML mapping of the Jetty API.

When Jetty deploys a web application, it automatically looks for a file called WEB-INF/jetty-env.xml within the web application (or WAR), and sets up the webapp naming environment so that naming references in the WEB-INF/web.xml file can be resolved from the information provided in the WEB-INF/jetty-env.xml and jetty.xml files. note

Additional Resources