File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes OO, Patterns, UML and Refactoring and the fly likes Access ServletContext in business layer Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » OO, Patterns, UML and Refactoring
Bookmark "Access ServletContext in business layer" Watch "Access ServletContext in business layer" New topic
Author

Access ServletContext in business layer

Jean Marcel Bacan
Greenhorn

Joined: Dec 04, 2012
Posts: 15
Hi,

I'm using a listener to start my OSGi container, so in the listener I instantiate my Framework passing the servlet container. (new Framework(servletContext))

While my framework is starting the container I must start my BundleActivator that also needs the servlet container. So I've this ugly thing:

Listener

Framework

Activator


Which is the best approach to decouple this servletContext? Singleton?

Thanks


OCPJP 6
 
Consider Paul's rocket mass heater.
 
subject: Access ServletContext in business layer