diff options
author | antelder <antelder@13f79535-47bb-0310-9956-ffa450edef68> | 2008-08-11 07:08:29 +0000 |
---|---|---|
committer | antelder <antelder@13f79535-47bb-0310-9956-ffa450edef68> | 2008-08-11 07:08:29 +0000 |
commit | 293c560a7126bd486c07162bf56a8ba16d5663b0 (patch) | |
tree | 98bf5a2ecd5a1b9ae753f9fe092696b1a3de09de | |
parent | 56761ea5fdb24c36c112a1f1bb9a78428c543a97 (diff) |
Support setting attributes in the app context
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@684650 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | java/sca/modules/host-webapp/src/main/java/org/apache/tuscany/sca/host/webapp/WebAppServletHost.java | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/java/sca/modules/host-webapp/src/main/java/org/apache/tuscany/sca/host/webapp/WebAppServletHost.java b/java/sca/modules/host-webapp/src/main/java/org/apache/tuscany/sca/host/webapp/WebAppServletHost.java index 97dc6bc622..599afc541c 100644 --- a/java/sca/modules/host-webapp/src/main/java/org/apache/tuscany/sca/host/webapp/WebAppServletHost.java +++ b/java/sca/modules/host-webapp/src/main/java/org/apache/tuscany/sca/host/webapp/WebAppServletHost.java @@ -64,6 +64,8 @@ public class WebAppServletHost implements ServletHost { private int defaultPortNumber = 8080; private String contributionRoot; + private ServletContext servletContext; + private WebAppServletHost() { servlets = new HashMap<String, Servlet>(); } @@ -208,7 +210,7 @@ public class WebAppServletHost implements ServletHost { public void init(ServletConfig config) throws ServletException { - ServletContext servletContext = config.getServletContext(); + servletContext = config.getServletContext(); if (servletContext.getAttribute(SCA_DOMAIN_ATTRIBUTE) == null) { initContextPath(config); String domainURI = "http://localhost/" + contextPath; @@ -223,6 +225,7 @@ public class WebAppServletHost implements ServletHost { for (Servlet servlet : servlets.values()) { servlet.init(config); } + } protected String getContributionRoot(ServletContext servletContext) { @@ -328,4 +331,8 @@ public class WebAppServletHost implements ServletHost { public String getContributionRoot() { return contributionRoot; } + + public void setAttribute(String name, Object value) { + servletContext.setAttribute(name, value); + } } |