In my experience, the Tomcat docs are specific to each version of Tomcat. If I were using Tomcat 6.0.24 I would look at the Tomcat 6 docs and ignore the previous
doc versions.
JNDI Resources HowTo
Under web.xml configuration:
Providing that Tomcat is able to identify an appropriate resource factory to use to create the resource and that no further configuration information is required, Tomcat will use the information in /WEB-INF/web.xml to create the resource.
Under context.xml configuration:
If Tomcat is unable to identify the appropriate resource factory and/or additional configuration information is required, additional Tomcat specific configuration must be specified before Tomcat can create the resource. Tomcat specific resource configuration is entered in the <Context> elements that can be specified in either $CATALINA_BASE/conf/server.xml or, preferably, the per-web-application context XML file (META-INF/context.xml).
...
If a resource has been defined in a <Context> element it is not necessary for that resource to be defined in /WEB-INF/web.xml. However, it is recommended to keep the entry in /WEB-INF/web.xml to document the resource requirements for the web application.
Which type of JNDI resource are you trying to create? User Database,
JDBC Data Source, LDAP?
You should start with the appropriate "Realm" on the realm-howto page, that stuff goes in server.xml
The "resource-ref" stuff goes in web.xml