[seam-dev] Loading resources from the ServletContext

Stuart Douglas stuart at baileyroberts.com.au
Fri Apr 9 07:52:38 EDT 2010


 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.

Stuart


On 09/04/2010, at 9:29 PM, Stuart Douglas wrote:

> 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?
> 
> 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. 
> 
> 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.
> 
> I really need this before the next release of seam-xml, as I currently can't load beans.xml from WEB-INF.
> 
> Stuart
> _______________________________________________
> seam-dev mailing list
> seam-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/seam-dev




More information about the seam-dev mailing list