summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEndi Sukma Dewata <edewata@redhat.com>2013-02-05 21:50:19 -0500
committerEndi Sukma Dewata <edewata@redhat.com>2013-02-05 21:50:19 -0500
commit3974b82ec4cfd360fa13d5fc108191e78af31c32 (patch)
tree05103d98d9e787f505f31dd6b717ee081731d2ca
parent981ebcce84770c9d48e80fc9b5ffd2bbf8fd0816 (diff)
downloadpki-dev3.zip
pki-dev3.tar.gz
pki-dev3.tar.xz
Added default config path.dev3
Previously the config path had to be defined in web.xml, so the web.xml had to be customized during deployment. The CMSStartServlet code now has been modified to generate the config path from catalina.base and webapp's context path by default.
-rw-r--r--base/ca/shared/webapps/ca/WEB-INF/web.xml2
-rw-r--r--base/common/src/com/netscape/cms/servlet/base/CMSStartServlet.java12
-rw-r--r--base/kra/shared/webapps/kra/WEB-INF/web.xml2
-rw-r--r--base/ocsp/shared/webapps/ocsp/WEB-INF/web.xml2
-rw-r--r--base/tks/shared/webapps/tks/WEB-INF/web.xml2
5 files changed, 12 insertions, 8 deletions
diff --git a/base/ca/shared/webapps/ca/WEB-INF/web.xml b/base/ca/shared/webapps/ca/WEB-INF/web.xml
index 286d1e3..582a717 100644
--- a/base/ca/shared/webapps/ca/WEB-INF/web.xml
+++ b/base/ca/shared/webapps/ca/WEB-INF/web.xml
@@ -332,8 +332,6 @@
<servlet-class> com.netscape.cms.servlet.base.CMSStartServlet </servlet-class>
<init-param><param-name> AuthzMgr </param-name>
<param-value> BasicAclAuthz </param-value> </init-param>
- <init-param><param-name> cfgPath </param-name>
- <param-value> [PKI_INSTANCE_PATH]/conf/[PKI_SUBSYSTEM_DIR]CS.cfg </param-value> </init-param>
<init-param><param-name> ID </param-name>
<param-value> castart </param-value> </init-param>
<load-on-startup> 1 </load-on-startup>
diff --git a/base/common/src/com/netscape/cms/servlet/base/CMSStartServlet.java b/base/common/src/com/netscape/cms/servlet/base/CMSStartServlet.java
index e00f2bd..3af4099 100644
--- a/base/common/src/com/netscape/cms/servlet/base/CMSStartServlet.java
+++ b/base/common/src/com/netscape/cms/servlet/base/CMSStartServlet.java
@@ -50,6 +50,18 @@ public class CMSStartServlet extends HttpServlet {
super.init(config);
String path = config.getInitParameter(PROP_CMS_CFG);
+ if (path == null) {
+ String[] s = config.getServletContext().getContextPath().split("/");
+ if (s.length < 2) {
+ throw new ServletException("Unable to get subsystem from context path");
+ }
+ String subsystem = s[1];
+
+ path = System.getProperty("catalina.base") + File.separator +
+ "conf" + File.separator +
+ subsystem + File.separator + "CS.cfg";
+ }
+
File f = new File(path);
String old_path = "";
if (!f.exists()) {
diff --git a/base/kra/shared/webapps/kra/WEB-INF/web.xml b/base/kra/shared/webapps/kra/WEB-INF/web.xml
index ca7d6ea..2072063 100644
--- a/base/kra/shared/webapps/kra/WEB-INF/web.xml
+++ b/base/kra/shared/webapps/kra/WEB-INF/web.xml
@@ -576,8 +576,6 @@
<servlet-class> com.netscape.cms.servlet.base.CMSStartServlet </servlet-class>
<init-param><param-name> AuthzMgr </param-name>
<param-value> BasicAclAuthz </param-value> </init-param>
- <init-param><param-name> cfgPath </param-name>
- <param-value> [PKI_INSTANCE_PATH]/conf/[PKI_SUBSYSTEM_DIR]CS.cfg </param-value> </init-param>
<init-param><param-name> ID </param-name>
<param-value> krastart </param-value> </init-param>
<load-on-startup> 1 </load-on-startup>
diff --git a/base/ocsp/shared/webapps/ocsp/WEB-INF/web.xml b/base/ocsp/shared/webapps/ocsp/WEB-INF/web.xml
index 1deadc9..a722123 100644
--- a/base/ocsp/shared/webapps/ocsp/WEB-INF/web.xml
+++ b/base/ocsp/shared/webapps/ocsp/WEB-INF/web.xml
@@ -96,8 +96,6 @@
<servlet-class> com.netscape.cms.servlet.base.CMSStartServlet </servlet-class>
<init-param><param-name> AuthzMgr </param-name>
<param-value> BasicAclAuthz </param-value> </init-param>
- <init-param><param-name> cfgPath </param-name>
- <param-value> [PKI_INSTANCE_PATH]/conf/[PKI_SUBSYSTEM_DIR]CS.cfg </param-value> </init-param>
<init-param><param-name> ID </param-name>
<param-value> ocspstart </param-value> </init-param>
<load-on-startup> 1 </load-on-startup>
diff --git a/base/tks/shared/webapps/tks/WEB-INF/web.xml b/base/tks/shared/webapps/tks/WEB-INF/web.xml
index b1958c0..44884c1 100644
--- a/base/tks/shared/webapps/tks/WEB-INF/web.xml
+++ b/base/tks/shared/webapps/tks/WEB-INF/web.xml
@@ -40,8 +40,6 @@
<servlet-class> com.netscape.cms.servlet.base.CMSStartServlet </servlet-class>
<init-param><param-name> AuthzMgr </param-name>
<param-value> BasicAclAuthz </param-value> </init-param>
- <init-param><param-name> cfgPath </param-name>
- <param-value> [PKI_INSTANCE_PATH]/conf/[PKI_SUBSYSTEM_DIR]CS.cfg </param-value> </init-param>
<init-param><param-name> ID </param-name>
<param-value> tksstart </param-value> </init-param>
<load-on-startup> 1 </load-on-startup>