On Tue, 10 Aug 2004 10:44:34 -0400, Seaman, Sloan <[EMAIL PROTECTED]> wrote: > This isn't a struts specific question (more towards tag-libs) but I figure > it is worth asking: > > Why does org.apache.taglivs.standard.tag.common.sql.DataSourceUtil assume > that the datasource is within java:comp/env? >
The "java:comp/env" context is the J2EE standard location for components ("comp") provided by the container to the environment ("env") of the application. As such, you will find it to be portable across any app server that implements JNDI resources in the J2EE standard way (including Tomcat). > What if you loaded it outside of Tomcat into another namespace (since Tomcat > makes java:comp/env read-only) so that your app is not tied to Tomcat's > server.xml file (in case you would want to change web servers easily)? > Every server will have it's own way of *configuring* resources into the standard environment, and those mechanisms will be server-dependent. However, the application using those resources will remain portable. > If I want to use <sql:query> I have to now load my datasource in Tomcats > context configuration because of this. > Only if you're using Tomcat. On some other server, you'd use that server's initialization mechanism -- but your application would still work. > Just curious if there is a set standard that says I have to use > java:comp/env and therefore am tied to Tomcat's config file since it makes > it read-only after initialization. > > Thanks! > -- > Sloan > > Craig --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]