Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 43747
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T15:32:38+00:00 2026-05-10T15:32:38+00:00

I’ve been looking into OSGi recently and think it looks like a really good

  • 0

I’ve been looking into OSGi recently and think it looks like a really good idea for modular Java apps.

However, I was wondering how OSGi would work in a web application, where you don’t just have code to worry about – also HTML, images, CSS, that sort of thing.

At work we’re building an application which has multiple ‘tabs’, each tab being one part of the app. I think this could really benefit from taking an OSGi approach – however I’m really not sure what would be the best way to handle all the usual web app resources.

I’m not sure whether it makes any difference, but we’re using JSF and IceFaces (which adds another layer of problems because you have navigation rules and you have to specify all faces config files in your web.xml… doh!)

Edit: according to this thread, faces-config.xml files can be loaded up from JAR files – so it is actually possible to have multiple faces-config.xml files included without modifying web.xml, provided you split up into JAR files.

Any suggestions would be greatly appreciated 🙂

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-10T15:32:38+00:00Added an answer on May 10, 2026 at 3:32 pm

    You are very right in thinking there are synergies here, we have a modular web app where the app itself is assembled automatically from independent components (OSGi bundles) where each bundle contributes its own pages, resources, css and optionally javascript.

    We don’t use JSF (Spring MVC here) so I can’t comment on the added complexity of that framework in an OSGi context.

    Most frameworks or approaches out there still adhere to the ‘old’ way of thinking: one WAR file representing your webapp and then many OSGi bundles and services but almost none concern themselves with the modularisation of the GUI itself.

    Prerequisites for a Design

    With OSGi the first question to solve is: what is your deployment scenario and who is the primary container? What I mean is that you can deploy your application on an OSGi runtime and use its infrastructure for everything. Alternatively, you can embed an OSGi runtime in a traditional app server and then you will need to re-use some infrastructure, specifically you want to use the AppServer’s servlet engine.

    Our design is currently based on OSGi as the container and we use the HTTPService offered by OSGi as our servlet container. We are looking into providing some sort of transparent bridge between an external servlet container and the OSGi HTTPService but that work is ongoing.

    Architectural Sketch of a Spring MVC + OSGi modular webapp

    So the goal is not to just serve a web application over OSGi but to also apply OSGi’s component model to the web UI itself, to make it composable, re-usable, dynamic.

    These are the components in the system:

    • 1 central bundle that takes care of bridging Spring MVC with OSGi, specifically it uses code by Bernd Kolb to allow you to register the Spring DispatcherServlet with OSGi as a servlet.
    • 1 custom URL Mapper that is injected into the DispatcherServlet and that provides the mapping of incoming HTTP requests to the correct controller.
    • 1 central Sitemesh based decorator JSP that defines the global layout of the site, as well as the central CSS and Javascript libraries that we want to offer as defaults.
    • Each bundle that wants to contribute pages to our web UI has to publish 1 or more Controllers as OSGi Services and make sure to register its own servlet and its own resources (CSS, JSP, images, etc) with the OSGi HTTPService. The registering is done with the HTTPService and the key methods are:

      httpService.registerResources() and httpService.registerServlet()

    When a web ui contributing bundle activates and publishes its controllers, they are automatically picked up by our central web ui bundle and the aforementioned custom URL Mapper gathers these Controller services and keeps an up to date map of URLs to Controller instances.

    Then when an HTTP request comes in for a certain URL, it finds the associated controller and dispatches the request there.

    The Controller does its business and then returns any data that should be rendered and the name of the view (a JSP in our case). This JSP is located in the Controller’s bundle and can be accessed and rendered by the central web ui bundle exactly because we went and registered the resource location with the HTTPService. Our central view resolver then merges this JSP with our central Sitemesh decorator and spits out the resulting HTML to the client.

    In know this is rather high level but without providing the complete implementation it’s hard to fully explain.

    Our key learning point for this was to look at what Bernd Kolb did with his example JPetstore conversion to OSGi and to use that information to design our own architecture.

    IMHO there is currently way too much hype and focus on getting OSGi somehow embedded in traditional Java EE based apps and very little thought being put into actually making use of OSGi idioms and its excellent component model to really allow the design of componentized web applications.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 62k
  • Answers 62k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer This should be possible with IIS using the host headers… May 11, 2026 at 10:00 am
  • added an answer The line that seems to be causing your execption is… May 11, 2026 at 10:00 am
  • added an answer If it makes the code better organized, I'll always try… May 11, 2026 at 10:00 am

Related Questions

I keep getting tasks that are above my skill level. How can I address this without coming accross as grossly incompetent?
I have a web-service that I will be deploying to dev, staging and production.
I'm thinking of starting a wiki, probably on a low cost LAMP hosting account.
I have the following tables in my database that have a many-to-many relationship, which
I'm using the RESTful authentication Rails plugin for an app I'm developing. I'm having
I recently printed out Jeff Atwood's Understanding The Hardware blog post and plan on
I find that getting Unicode support in my cross-platform apps a real pain in
I would like to test a string containing a path to a file for
I'm getting this problem: PHP Warning: mail() [function.mail]: SMTP server response: 550 5.7.1 Unable
I'm an Information Architect and JavaScript developer by trade nowadays, but recently I've been

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.