Thanks for the quick response Peter!
For a follow up...
Say that I have a framework (like Spring) that has another layer of code where you can have a "datasource" bean that essentially holds the jndi name (eg. jdbc/TheDS) in a spring context xml file. Spring converts the jndi name to java:comp/env/jdbc/TheDS in the background.
Would JBoss still see be able to see that the code is using java:comp/env in front of TheDS jndi name even though the java:comp/env is appended in front of TheDS jndi name only at runtime by Spring used in a class (org.springframework.jdbc.core.JdbcTemplate) found inside a Spring jar.
In other words using a framework like Spring that manages datasources at the application layer can we still successfully map to JBoss's -ds.xml jndi name java:jdbc/SomeDS.
Another answer to a question I would love to know is if this mapping technique can be done only for WARs in JBoss? How about if I just have a bunch of EJBs and/or jars packaged in an EAR file. Is there an EAR equivalent technique to map the jndi names to the JBoss' -ds.xml jndi name.
Again, I appreciate your help!