<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>I have rolled back the changes, however I am not sure if it is possible to do this as a decorator. &nbsp;From the spec section on how decorators are bound to beans:</div><div><br></div><div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Helvetica; ">8.3.&nbsp;A decorator is bound to a bean if: ....&nbsp;The decorator is enabled in the bean archive containing the bean</div></div><div><br></div><div>I read this as meaning that I would need to add the Decorator to the beans.xml of weld-extensions to bind the decorator to&nbsp;ResourceLoaderImpl, which would mean a dependency on seam-servlet from weld-extensions, which is not ok.</div><div><br></div><div>If this is the case what about removing the private constructor of &nbsp;ResourceLoaderImpl and specialising it in seam-servlet?</div><div><br></div><div>Stuart</div><br><div><div>On 10/04/2010, at 12:32 AM, Pete Muir wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>I noticed you committed a change that hard links the resource loader to the servlet context - we really need to avoid doing things like this - now we've tied every module that uses resources to running in Servlet! Seam 3 is no longer usable in Weld SE....<br><br>I designed the resource loading mechanism to be full extensible, and allow alternative sources of resources outside the classpath. So, what we can do inside the Servlet module, is provide a decorator for ResourceLoader that adds in the ability to load from the ServletContext. This way the need to duplicate all the logic for exposing the ServletContext via a producer is avoided to.<br><br>Stuart, can you back out the changes you made to Weld Extensions (excluding the getResources() changes), and add them into the servlet module from Seam as a decorator?<br><br>Thanks!<br><br>On 9 Apr 2010, at 12:52, Stuart Douglas wrote:<br><br><blockquote type="cite">Nik just pointed out on IRC that the BeanManager is availible before the ServletContext is created, so I can fire a CDI event in the ServletContextListener and then observe it in an Extension, which should solve my problem.<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Stuart<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">On 09/04/2010, at 9:29 PM, Stuart Douglas wrote:<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><blockquote type="cite">I know there are plans to add loading resources from the ServletContext to the resource loading stuff in weld extensions, and I was wondering if anyone had any idea's as to how to implement this?<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">I was thinking about registering a ServletContextListener to get hold of the ServletContext. For a war deployment this could be registered automatically with a web fragment, while for an ear this will probably have to be registered manually. <br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">The only thing I am not really sure about is where to store the references to the ServletContexts. As this is before Weld has started, I can't just stick it in an application scoped bean or similar, and storing it in a static would require weld-extensions (and thus seam-xml, and any other modules that depend upon weld-extensions) to be included in the deployment, and not in the app servers lib directory. I don't think that this is really acceptable, however I can't think of any other way off the the top of my head.<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">I really need this before the next release of seam-xml, as I currently can't load beans.xml from WEB-INF.<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">Stuart<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">_______________________________________________<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">seam-dev mailing list<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><a href="mailto:seam-dev@lists.jboss.org">seam-dev@lists.jboss.org</a><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><a href="https://lists.jboss.org/mailman/listinfo/seam-dev">https://lists.jboss.org/mailman/listinfo/seam-dev</a><br></blockquote></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">_______________________________________________<br></blockquote><blockquote type="cite">seam-dev mailing list<br></blockquote><blockquote type="cite"><a href="mailto:seam-dev@lists.jboss.org">seam-dev@lists.jboss.org</a><br></blockquote><blockquote type="cite"><a href="https://lists.jboss.org/mailman/listinfo/seam-dev">https://lists.jboss.org/mailman/listinfo/seam-dev</a><br></blockquote><br></div></blockquote></div><br></body></html>