定义在server.xml中的环境变量如下ResourceLink元素是我使用Apache的Tomcat的7.0.35.I不工作
<GlobalNamingResources>
<Environment name="sam"
value="D:\AppServers\apache-tomcat-7.0.35\conf\sample.xml"
type="java.lang.String" override="true"/>
</GlobalNamingResources>
我使用ResourceLink元素在侧我上下文元素在context.xml中
<?xml version="1.0" encoding="UTF-8"?>
<Context path="/Practice_1" docBase="/Practice_1"
crossContext="true" reloadable="true" debug="1">
<ResourceLink name="sam" global="sam" type="java.lang.String"/>
</Context>
当我尝试使用
Context initCtx = new InitialContext();
String configPath = (String)initCtx.lookup("sam");
它扔得到这个valuue代码
我该如何解决这个问题?