This week's book giveaway is in the Android forum.
We're giving away four copies of Head First Android and have Dawn & David Griffiths on-line!
See this thread for details.
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


Win a copy of Head First Android this week in the Android forum!
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
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Access ServletContext in business layer
 
It's not a secret anymore!