getResourceAsStream vs JNDI



I was wondering what is the use of getting the resource from jndi
context vs resource stream. If it is not an enterprise applicaiton and
you control the deploy then the getResourceAsStream seems better and
not to get in complication of jndi, esp when you are not using any app
container? is it correct, is there any benefit of jndi lookup when it
is a web application.
.



Relevant Pages

  • Re: getResourceAsStream vs JNDI
    ... context vs resource stream. ... not to get in complication of jndi, esp when you are not using any app ... The justification in the EE architecture is that classpath resources are set once, at compile time, whereas configuration can change at every deployment and should not be "baked into" the JARs, WARs, and EARs. ... There's an unfortunate tropism towards in-JAR configuration in the EE and servlet worlds, though, because it's the simplest thing that could work: the mechanism for configuring EE apps' JNDI entries from the outside is not standardised, so you get to compare Tomcat's context XML configuration to JBoss' to WebSphere's to Glassfish's and discover there's almost zero knowledge portability beyond "the app uses JNDI to pick this up." ...
    (comp.lang.java.programmer)
  • Re: Using Apache Derby in Tomcat application
    ... your application environment. ... Thanks for the suggestion. ... I don't have control over the app itself. ... It expects to find "jdbc/rollerdb" from JNDI, ...
    (comp.lang.java.databases)