简体   繁体   English

在Tomcat7中设置自定义属性

[英]Set custom property in Tomcat7

We are running our application using Tomcat-7 in Windows environment. 我们正在Windows环境中使用Tomcat-7运行我们的应用程序。 We are using Shibboleth IDP for our application, due to this we need to set system property at the container level to identify one new property called "idp.home". 我们将Shibboleth IDP用于我们的应用程序,因此,我们需要在容器级别设置系统属性,以标识一个名为“ idp.home”的新属性。 So we found that the property can be set in "catalina.properties". 因此,我们发现可以在“ catalina.properties”中设置该属性。 We set it and it was running successfully by using "idp.home" property but the problem is that if we use the same compiled war file in another machine, the property "idp.home" is not working. 我们通过使用“ idp.home”属性对其进行了设置,并使其成功运行,但是问题是,如果我们在另一台计算机上使用相同的已编译war文件,则“ idp.home”属性将无法正常工作。

cataline.properties cataline.properties

idp.home=../../IdP idp.home = .. / .. / IdP

Structure: 结构体:

Build --> IdP 建立-> IdP
--> tomcat-->conf-->catalina.properties -> tomcat-> conf-> catalina.properties

Queries: 1) Is custom property "idp.home" cached in tomcat some where? 查询:1)定制属性“ idp.home”是否存储在tomcat中的某些位置? 2) do we need to set "idp.home" property in any file along with the "catalina.properties" in tomcat. 2)我们是否需要在任何文件中设置“ idp.home”属性以及tomcat中的“ catalina.properties”。

3) Is there any other way to inform tomcat about "idp.home"? 3)还有其他方法可以向tomcat通知“ idp.home”吗?

Thanks in advance. 提前致谢。

  1. We can pass system properties with the -D parameter as VM arguments to tomcat, for example "-Dmy.prop.name=value" or 我们可以将带有-D参数的系统属性作为VM参数传递给tomcat,例如“ -Dmy.prop.name = value”或
  2. Place system properties in a property file and specify the path of the property file in VM arguments, for example -Dcom.propertyfiles="path of the property File" 将系统属性放在属性文件中,并在VM参数中指定属性文件的路径,例如-Dcom.propertyfiles =“属性文件的路径”

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM