From: Marc P. <ma...@an...> - 2005-05-24 18:49:24
|
Keats Kirsch wrote: > I don't like the "smell" of this. Why do you need it anyway? If you > need the Servlet instance you can just use: > > (Servlet)pageContext.getPage() Well: 1. is that always guaranteed to be the case 2. will it definitely be the same classloader as a servlet in the same webapp, and the same for all JSPs that use the taglib in that webapp? 3. it doesn't work from Spring views. 4. it requires a lazy init of the single-instance of WM. I have added this to the taglib code already, so that it can use ServletContextBroker. > Anyway, I thought you didn't need to use the Servlet instance if you use > the new Broker -- wasn't that the point? True, but you were the one who said there should be an option to load things from the servlet classpath :) The problem is you can't get WM to load context tools etc from the webapp classpath if you don't have the servlet classpath. I think my solution is neat, in an ugly way :( It's a quick and easy way to solve the problem, without violating any particular rules I know of. The other option would be to put the Servlet or its ClassLoader into a predefined JNDI naming context. Do you like that less, or more ;-( -- Marc Palmer wj...@wa... Wangjammers - Java, J2ME and Web Consultants ~ http://www.wangjammers.org/ |