(1)配置:
D:/apache-tomcat-6.0.30/conf/Catalina/localhost 文件夹下添加:TestWorkFlow.xml,其中TestWorkFlow为项目的context-root
(2)新建Jndi类
2.1 Jndi.java
(3)测试:index.jsp
http://wiki.apache.org/tomcat/FAQ/Miscellaneous#Q22
Can I access Tomcat's JNDI provider from outside tomcat?
Not at this time.
所以,必须在tomcat容器中才能使用JNDI
如果通过main函数获取jndi
会出现如下错误: