wood burning stoves 2.0*
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 Android Security Essentials Live Lessons 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

Access ServletContext in business layer

Jean Marcel Bacan

Joined: Dec 04, 2012
Posts: 15

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:




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


I agree. Here's the link: http://aspose.com/file-tools
subject: Access ServletContext in business layer
Similar Threads
Calling Servlet method from Bean
Spring - Multiple IoC Containers with Singleton Bean in a JVM
Spliting Spring Configurations
Alternative Implementations of MVC
A doubt about a listener