From: Marc P. <ma...@an...> - 2005-05-21 18:49:35
|
Keats Kirsch wrote: > It needs the servletContext *and* the classloader for the > servletContext. WM can get both from the Servlet, which is why it was > done that way. I don't think there is a guaranteed way to get the > servlet classloader from the servletContext. > > Let's not break all the old WM servlet code. However if you want to be > explicitly pass in both arguments, I don't see any problem with that. Precisely what I was talking of doing. Breaking stuff is not going to happen :) However I am interested in any ideas for getting a reference to the web application's own ClassLoader from within a class that has no reference to the Serlvet, only the ServletContext. I suppose in theory you could use the (most/all deprecated) methods on ServletContext to iterate over the servlets and just grab any one and call getClass().getClassLoader() on it. Doesn't feel good though... -- Marc Palmer wj...@wa... Wangjammers - Java, J2ME and Web Consultants ~ http://www.wangjammers.org/ |