| <html><head> | |
| <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> | |
| <title>Deploying Web Applications</title><link rel="stylesheet" type="text/css" href="css/docbook.css"><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"><meta name="keywords" content="jetty, servlet, servlet-api, cometd, http, spdy, websocket, eclipse, maven, java, server, software"><link rel="home" href="index.html" title="Jetty : The Definitive Reference"><link rel="up" href="quick-start-getting-started.html" title="Chapter 2. Using Jetty Introduction"><link rel="prev" href="quickstart-running-jetty.html" title="Running Jetty"><link rel="next" href="quickstart-jetty-coordinates.html" title="Finding Jetty in Maven"><link xmlns:jfetch="java:org.eclipse.jetty.xslt.tools.JavaSourceFetchExtension" xmlns:fetch="java:org.eclipse.jetty.xslt.tools.SourceFetchExtension" xmlns:d="http://docbook.org/ns/docbook" xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0" xmlns:xslthl="http://xslthl.sf.net" xmlns:gcse="http://www.google.com" xmlns:date="http://exslt.org/dates-and-times" rel="shortcut icon" href="images/favicon.ico"><script type="text/javascript" src="js/shCore.js"></script><script type="text/javascript" src="js/shBrushJava.js"></script><script type="text/javascript" src="js/shBrushXml.js"></script><script type="text/javascript" src="js/shBrushBash.js"></script><script type="text/javascript" src="js/shBrushJScript.js"></script><script type="text/javascript" src="js/shBrushSql.js"></script><script type="text/javascript" src="js/shBrushProperties.js"></script><script type="text/javascript" src="js/shBrushPlain.js"></script><link type="text/css" rel="stylesheet" href="css/shCore.css"><link type="text/css" rel="stylesheet" href="css/shThemeEclipse.css"><link type="text/css" rel="stylesheet" href="css/font-awesome.min.css"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><table xmlns:jfetch="java:org.eclipse.jetty.xslt.tools.JavaSourceFetchExtension" xmlns:fetch="java:org.eclipse.jetty.xslt.tools.SourceFetchExtension" xmlns:d="http://docbook.org/ns/docbook" xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0" xmlns:xslthl="http://xslthl.sf.net" xmlns:gcse="http://www.google.com" xmlns:date="http://exslt.org/dates-and-times"><tr><td style="width: 25%"><a href="http://www.eclipse.org/jetty"><img src="images/jetty-header-logo.png" alt="Jetty Logo"></a><br><span style="font-size: small"> | |
| Version: 9.2.21.v20170120</span></td><td style="width: 50%"><script type="text/javascript"> (function() { | |
| var cx = '016459005284625897022:obd4lsai2ds'; | |
| var gcse = document.createElement('script'); | |
| gcse.type = 'text/javascript'; | |
| gcse.async = true; | |
| gcse.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') + | |
| '//www.google.com/cse/cse.js?cx=' + cx; | |
| var s = document.getElementsByTagName('script')[0]; | |
| s.parentNode.insertBefore(gcse, s); | |
| })(); | |
| </script><gcse:search></gcse:search></td></tr></table><div xmlns:jfetch="java:org.eclipse.jetty.xslt.tools.JavaSourceFetchExtension" xmlns:fetch="java:org.eclipse.jetty.xslt.tools.SourceFetchExtension" xmlns:d="http://docbook.org/ns/docbook" xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0" xmlns:xslthl="http://xslthl.sf.net" xmlns:gcse="http://www.google.com" xmlns:date="http://exslt.org/dates-and-times" class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Deploying Web Applications</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="quickstart-running-jetty.html"><i class="icon-chevron-left"></i> Previous</a> </td><th width="60%" align="center">Chapter 2. Using Jetty Introduction<br><a accesskey="p" href="index.html"><i class="icon-home"></i> Home</a></th><td width="20%" align="right"> <a accesskey="n" href="quickstart-jetty-coordinates.html">Next <i class="icon-chevron-right"></i></a></td></tr></table><hr></div><div xmlns:jfetch="java:org.eclipse.jetty.xslt.tools.JavaSourceFetchExtension" xmlns:fetch="java:org.eclipse.jetty.xslt.tools.SourceFetchExtension" xmlns:d="http://docbook.org/ns/docbook" xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0" xmlns:xslthl="http://xslthl.sf.net" xmlns:gcse="http://www.google.com" xmlns:date="http://exslt.org/dates-and-times" class="jetty-callout"><h5 class="callout"><a href="http://www.webtide.com/">Contact the core Jetty developers at | |
| <span class="website">www.webtide.com</span></a></h5><p> | |
| private support for your internal/customer projects ... custom extensions and distributions ... versioned snapshots for indefinite support ... | |
| scalability guidance for your apps and Ajax/Comet projects ... development services from 1 day to full product delivery | |
| </p></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="quickstart-deploying-webapps"></a>Deploying Web Applications</h2></div></div></div><div class="toc"><dl><dt><span class="section"><a href="quickstart-deploying-webapps.html#d0e1152">Jetty Demonstration Web Applications</a></span></dt></dl></div><p>Jetty server instances that configures the deploy module will have a | |
| web application deployer that hot deploys files found in the<code class="filename"> | |
| webapps</code> directory. Standard WAR files and jetty configuration | |
| files that you place in the <code class="filename"> webapps</code> directory are hot | |
| deployed to the server with the following conventions:</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>A directory called <code class="filename">example/</code> is deployed as a | |
| standard web application if it contains a <code class="filename">WEB-INF/</code> | |
| subdirectory, otherwise it is deployed as context of static content. The | |
| context path is <code class="filename">/example</code> (that is, | |
| <code class="filename">http://localhost:8080/example/</code>) unless the base | |
| name is ROOT (case insensitive), in which case the context path is /. If | |
| the directory name ends with ".d" it is ignored (but may be used by | |
| explicit configuration).</p></li><li class="listitem"><p>A file called <code class="filename">example.war</code> is deployed as a | |
| standard web application with the context path | |
| <code class="filename">/example</code> (that is, | |
| <code class="filename">http://localhost:8080/example/</code>). If the base name | |
| is <code class="filename">ROOT</code> (case insensitive), the context path is /. | |
| If <code class="filename"> example.war</code> and <code class="filename">example/</code> | |
| exist, only the WAR is deployed (which may use the directory as an | |
| unpack location).</p></li><li class="listitem"><p>An XML file like <code class="filename">example.xml</code> is deployed as a | |
| context whose configuration is defined by the XML. The configuration | |
| itself must set the context path. If <code class="filename">example.xml</code> | |
| and <code class="filename">example.war</code> exist, only the XML is deployed | |
| (which may use the WAR in its configuration).</p></li></ul></div><p>If you have a standard web application, you can hot deploy it into | |
| Jetty by copying it into the <code class="filename"> webapps</code> directory.</p><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="d0e1152"></a>Jetty Demonstration Web Applications</h3></div></div></div><p>The demo-base/webapps directory contains the following deployable | |
| and auxiliary files:</p><div class="variablelist"><dl><dt><span class="term"><code class="filename">ROOT/</code></span></dt><dd><p>A directory of static content that is deployed to the root | |
| context / due to it's name. Contains the Jetty demo welcome | |
| page.</p></dd><dt><span class="term"><code class="filename">test.xml</code></span></dt><dd><p>A context configuration file that configures and deploys | |
| <code class="filename">test.war.</code> The additional configuration includes | |
| the context path as well as setting additional descriptors found in | |
| the test.d directory.</p></dd><dt><span class="term"><code class="filename">test.war</code></span></dt><dd><p>The demonstration web application that <code class="filename">is</code> | |
| configured and deployed by test.xml.</p></dd><dt><span class="term"><code class="filename">test.d</code></span></dt><dd><p>A directory containing additional configuration files used by | |
| <code class="filename">test.xml</code> to inject extra configuration into | |
| <code class="filename">test.war</code>.</p></dd><dt><span class="term"><code class="filename">async-rest.war</code></span></dt><dd><p>A web application demonstration of asynchronous REST to eBay, | |
| automatically deployed to /async-rest based on the file name.</p></dd><dt><span class="term"><code class="filename">test-jaas.war</code></span></dt><dd><p>A demonstration web application utilising <a class="link" href="jaas-support.html" title="JAAS Support">JAAS</a> for authentication.</p></dd><dt><span class="term"><code class="filename">test-jaas.xml</code></span></dt><dd><p>A context configuration file that configures | |
| <code class="filename">test-jaas.war</code>. Additional configuration | |
| includes setting up the <a class="link" href="configuring-security-authentication.html#configuring-login-service" title="Configuring a LoginService">LoginService</a> for | |
| authentication and authorization.</p></dd><dt><span class="term"><code class="filename">test-jndi.war</code></span></dt><dd><p>A demonstration web application showing the use of <a class="link" href="jndi.html" title="Chapter 11. Configuring JNDI">JNDI</a>.</p></dd><dt><span class="term"><code class="filename">test-jndi.xml</code></span></dt><dd><p>A context configuration file that configures<code class="filename"> | |
| test-jndi.war</code>. Additional configuration includes defining | |
| objects in the naming space that can be referenced from the | |
| webapp.</p></dd><dt><span class="term"><code class="filename">test-spec.war</code></span></dt><dd><p>A demonstration web application that shows the use of | |
| annotations, fragments, ServletContainerInitializers and other | |
| Servlet Specification 3.0/3.1 features.</p></dd><dt><span class="term"><code class="filename">test-spec.xml</code></span></dt><dd><p>A context configuration file that configures<code class="filename"> | |
| test-spec.war</code>. Additional configuration includes setting | |
| up some objects in the naming space that can be referenced by | |
| annotations.</p></dd><dt><span class="term"><code class="filename">xref-proxy.war</code></span></dt><dd><p>A demonstration web application that uses a transparent proxy | |
| to serve the Jetty src <a class="link" href="http://download.eclipse.org/jetty/stable-9/xref/" target="_top">xref</a> | |
| from the Eclipse <a class="link" href="http://www.eclipse.org/jetty" target="_top">website</a>.</p></dd><dt><span class="term"><code class="filename">example-moved.xml</code></span></dt><dd><p>A demonstration context configuration file that shows how to | |
| use the <a class="link" href="moved-context-handler.html" title="Moved Context Handler">MovedContextHandler</a> to | |
| redirect from one path to another.</p></dd></dl></div></div></div><script type="text/javascript"> | |
| SyntaxHighlighter.all() | |
| </script><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="quickstart-running-jetty.html"><i class="icon-chevron-left"></i> Previous</a> </td><td width="20%" align="center"><a accesskey="u" href="quick-start-getting-started.html"><i class="icon-chevron-up"></i> Top</a></td><td width="40%" align="right"> <a accesskey="n" href="quickstart-jetty-coordinates.html">Next <i class="icon-chevron-right"></i></a></td></tr><tr><td width="40%" align="left" valign="top">Running Jetty </td><td width="20%" align="center"><a accesskey="h" href="index.html"><i class="icon-home"></i> Home</a></td><td width="40%" align="right" valign="top"> Finding Jetty in Maven</td></tr></table></div><p xmlns:jfetch="java:org.eclipse.jetty.xslt.tools.JavaSourceFetchExtension" xmlns:fetch="java:org.eclipse.jetty.xslt.tools.SourceFetchExtension" xmlns:d="http://docbook.org/ns/docbook" xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0" xmlns:xslthl="http://xslthl.sf.net" xmlns:gcse="http://www.google.com" xmlns:date="http://exslt.org/dates-and-times"><div class="jetty-callout"> | |
| See an error or something missing? | |
| <span class="callout"><a href="http://github.com/jetty-project/jetty-documentation">Contribute to this documentation at | |
| <span class="website"><i class="icon-github"></i> Github!</span></a></span><span style="float: right"><i>(Generated: 2015-03-13T11:47:48-05:00)</i></span></div></p><script xmlns:jfetch="java:org.eclipse.jetty.xslt.tools.JavaSourceFetchExtension" xmlns:fetch="java:org.eclipse.jetty.xslt.tools.SourceFetchExtension" xmlns:d="http://docbook.org/ns/docbook" xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0" xmlns:xslthl="http://xslthl.sf.net" xmlns:gcse="http://www.google.com" xmlns:date="http://exslt.org/dates-and-times" type="text/javascript"> | |
| var _gaq = _gaq || []; | |
| _gaq.push(['_setAccount', 'UA-1149868-7']); | |
| _gaq.push(['_trackPageview']); | |
| (function() { | |
| var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; | |
| ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; | |
| var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); | |
| })(); | |
| </script></body></html> |