This content has been marked as final. 
    
Show                 2 replies
    
- 
        1. Re: ServletContext.getResourceAsStream() problem?ko5tik Mar 15, 2004 5:14 AM (in response to ko5tik)After planting various debug out int my WebappLoader, I just discovered that when I say ServletCcontext.getResource(String), 
 it's loaded via JNDI.
 Here is java code fragment:for (int i=0; i < paths.length; i++) { try { System.err.println("checking path: " + paths); result = servletContext.getResourceAsStream(paths + name); /* exit the loop if we found the template */ if (result != null) { System.err.println("found resource " + name + " at: " + servletContext.getResource(paths + name)); break; } } catch (Exception e) { /* only save the first one for later throwing */ if (exception == null) { exception = e; } } }
 And here is the result:
 11:41:13,568 ERROR [STDERR] checking path: /
 11:41:13,571 ERROR [STDERR] found resource index.vm at: jndi:/localhost/unadmin/index.vm
 From both webapps identical...
 Is this problem known? Any workarounds? 3.2.0 worked better...
- 
        2. Re: ServletContext.getResourceAsStream() problem?ko5tik Mar 15, 2004 5:54 AM (in response to ko5tik)OK, Further investigation shows, that 2 independet web applications can share singleton instance of velocity. 
 How is this possible?
