Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGreg Wilkins2012-11-26 05:56:39 +0000
committerGreg Wilkins2012-11-26 05:57:37 +0000
commit9a4e5f3301aad09659b8d281b5c7d187aaa847f5 (patch)
tree3b0533bf19ba74af2f349e2b452c001badc5da43 /jetty-deploy/src
parent0eeef6ab4ec6c6b6752952e9e6f60640e5dd4956 (diff)
downloadorg.eclipse.jetty.project-9a4e5f3301aad09659b8d281b5c7d187aaa847f5.tar.gz
org.eclipse.jetty.project-9a4e5f3301aad09659b8d281b5c7d187aaa847f5.tar.xz
org.eclipse.jetty.project-9a4e5f3301aad09659b8d281b5c7d187aaa847f5.zip
jetty-9 Added proxy test webapp. Refined no servlet context handling
Diffstat (limited to 'jetty-deploy/src')
-rw-r--r--jetty-deploy/src/main/java/org/eclipse/jetty/deploy/bindings/GlobalWebappConfigBinding.java8
-rw-r--r--jetty-deploy/src/main/java/org/eclipse/jetty/deploy/providers/WebAppProvider.java7
2 files changed, 14 insertions, 1 deletions
diff --git a/jetty-deploy/src/main/java/org/eclipse/jetty/deploy/bindings/GlobalWebappConfigBinding.java b/jetty-deploy/src/main/java/org/eclipse/jetty/deploy/bindings/GlobalWebappConfigBinding.java
index 416d4ec121..ef9179ce44 100644
--- a/jetty-deploy/src/main/java/org/eclipse/jetty/deploy/bindings/GlobalWebappConfigBinding.java
+++ b/jetty-deploy/src/main/java/org/eclipse/jetty/deploy/bindings/GlobalWebappConfigBinding.java
@@ -18,6 +18,8 @@
package org.eclipse.jetty.deploy.bindings;
+import java.io.File;
+
import org.eclipse.jetty.deploy.App;
import org.eclipse.jetty.deploy.AppLifeCycle;
import org.eclipse.jetty.deploy.graph.Node;
@@ -92,6 +94,12 @@ public class GlobalWebappConfigBinding implements AppLifeCycle.Binding
{
XmlConfiguration jettyXmlConfig = new XmlConfiguration(globalContextSettings.getInputStream());
+ Resource resource = Resource.newResource(app.getOriginId());
+ File file = resource.getFile();
+ jettyXmlConfig.getIdMap().put("Server",app.getDeploymentManager().getServer());
+ jettyXmlConfig.getProperties().put("jetty.webapp",file.getCanonicalPath());
+ jettyXmlConfig.getProperties().put("jetty.webapps",file.getParentFile().getCanonicalPath());
+
jettyXmlConfig.configure(context);
}
else
diff --git a/jetty-deploy/src/main/java/org/eclipse/jetty/deploy/providers/WebAppProvider.java b/jetty-deploy/src/main/java/org/eclipse/jetty/deploy/providers/WebAppProvider.java
index 8b301d8035..a2b5bfeb48 100644
--- a/jetty-deploy/src/main/java/org/eclipse/jetty/deploy/providers/WebAppProvider.java
+++ b/jetty-deploy/src/main/java/org/eclipse/jetty/deploy/providers/WebAppProvider.java
@@ -27,6 +27,7 @@ import java.util.Locale;
import org.eclipse.jetty.deploy.App;
import org.eclipse.jetty.deploy.ConfigurationManager;
import org.eclipse.jetty.deploy.util.FileID;
+import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.server.handler.ContextHandler;
import org.eclipse.jetty.util.URIUtil;
import org.eclipse.jetty.util.annotation.ManagedAttribute;
@@ -57,7 +58,8 @@ import org.eclipse.jetty.xml.XmlConfiguration;
* <li>If a WAR file and a matching XML exist (eg foo.war and foo.xml) then the WAR is assumed to
* be configured by the XML and only the XML is deployed.
* </ul>
- *
+ * <p>For XML configured contexts, the ID map will contain a reference to the {@link Server} instance called "Server" and
+ * properties for the webapp file as "jetty.webapp" and directory as "jetty.webapps".
*/
@ManagedObject("Provider for start-up deployement of webapps based on presence in directory")
public class WebAppProvider extends ScanningAppProvider
@@ -267,6 +269,9 @@ public class WebAppProvider extends ScanningAppProvider
XmlConfiguration xmlc = new XmlConfiguration(resource.getURL());
xmlc.getIdMap().put("Server",getDeploymentManager().getServer());
+ xmlc.getProperties().put("jetty.webapp",file.getCanonicalPath());
+ xmlc.getProperties().put("jetty.webapps",file.getParentFile().getCanonicalPath());
+
if (getConfigurationManager() != null)
xmlc.getProperties().putAll(getConfigurationManager().getProperties());
return (ContextHandler)xmlc.configure();

Back to the top