【发布时间】:2015-12-04 23:44:44
【问题描述】:
在 tomcat 服务器上,我需要通过使用 jndi 从 Context.xml/Server.xml/Web.xml 读取值来填充单例字符串列表以用于 spring 应用程序。我发现没有标签带有列表参数而不是 Environment/Resource/Parameter。
我找到了解决办法
<context-param>
<param-name>SystemVariables</param-name>
<param-value>ex1.com,ex2.com,ex3.com</param-value>
</context-param>
选择值后我必须从哪里拆分它然后填充列表。
但之前我们使用树脂,我们像下面这样放置 jndi
<resource jndi-name="SystemVariables">
<type>com.example.SystemVariables</type>
<init>
<VarDescList>ex1.com</VarDescList>
<VarDescList>ex2.com</VarDescList>
<VarDescList>ex3.com</VarDescList>
</init>
</resource>
我们如何让它在 tomcat 中工作?
【问题讨论】:
标签: java xml spring tomcat context.xml