Win a copy of Java EE 8 High Performance this week in the Java/Jakarta EE forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

InitialContext question  RSS feed

Ranch Hand
Posts: 247
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I wrote a servlet that creates an InitialContext then performs a lookup (it's getting a DataSource from the app server). The server is iPlanet. While researching using Tomcat with DataSources, a co-worker noted that most of the Tomcat examples included "java:comp/env" in the lookup, where mine does not. Is the "java:comp/env" the default if you don't specify it? Does it even need to be there for Tomcat? Should I add it to the iPlanet code 'to be safe'? Is adding this only useful for doing lookups on EJBs and other resources? Do other servlet engines and app servers have requirements for the string to be there as part of the lookup? Any explanation or pointers would be useful.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!