Results 1 to 9 of 9

Thread: web resources per bundle

  1. #1
    Join Date
    Feb 2007
    Location
    New Hampshire
    Posts
    54

    Default web resources per bundle

    I described this use case before but I have a new question. To start I'll describe a web application:

    I have a web application with 20 dependencies that we write in house. Those 20 dependencies each add new functionality to the web application.

    For example. Lets say the web application is a zoo, and the 20 dependencies are 5 exhibits and 15 animals where animals reside within exhibits. Each exhibit and animal has their own web resources (jsp, js, css, images) and java classes. At build time, maven reaches into each of the modules and pull up the web resources into the web application's target. So this application is assembled 100% at build time.

    In order to add a new animal, I have to develop the new jar, tell the web app's pom all about the new animal module and how to get the web resources. I have to build a whole new war and redeploy the war to the server.

    What I would like to be able to do is have a web app that runs and to be able to add new exhibits and animals to the application\WEB-INF\lib and see the new features added to the web application.
    The question is, can I store web resources, to include jsp, css, javascript, and images within each bundle? If so, are those bundles wars? Are there any examples of this around the internets?

    Thank you.

    ~ Mike

  2. #2
    Join Date
    Jan 2005
    Location
    Bucharest, Romania
    Posts
    5,403

    Default

    Bundles can contain both classes and resources - the versioning and modularity rules apply to all of them. Not sure what you mean by bundle wars - they are both archives and the meaning is actually given their structure and the context in which they are meant to be used.
    Using web containers in OSGi can be tricky but there are plenty of alternatives out there - some understand wars natively, others require some small processing while others require programmatic registration (i.e. the wars themselves are not supported).

    Just google for web application and osgi or war and OSGi and you should find some hits. The Spring DM reference documentation offers some help in this area as well (as do the samples from the distribution).
    Costin Leau
    SpringSource - http://www.SpringSource.com- Spring Training, Consulting, and Support - "From the Source"
    http://twitter.com/costinl
    Please use [ c o d e ] [ / c o d e ] tags

  3. #3
    Join Date
    Feb 2007
    Location
    New Hampshire
    Posts
    54

    Default

    Costin, I have been working from this tutorial <http://springosgi.googlepages.com/ch01.html> for a couple of days now with some progress.

    I took the example with simpleweb.war and copied it out to project2.war and project3.war and deployed them all. Each war has web resources such as jsp, images, css, and javascript.

    I can now get to /simpleweb/index.jsp, /project2/index.jsp, and /project3/index.jsp. However they are three different web apps with three different sessions (I logged session ids to confirm).

    Here is exactly what I have got: <http://www.screentoaster.com/watch/stU09VQkdIR11dRF1ZWl1aUFNQ/osgi_3_web_apps>

    What does it take to get them as one web project with resources spread across three bundles?

    I have to get to something like /simpleweb/index.jsp, /simpleweb/project2/index.jsp, and /simpleweb/project3./index.jsp with each additional project defining their path via their web.xml. I would like to be able to add /smpleweb/project4 by just adding a new bundle and not modifying any other bundle.

    Is this possible? Is this what osgi with web support should be able to do?

    Thank you.
    Last edited by MikeNereson; May 15th, 2009 at 11:33 AM.

  4. #4
    Join Date
    Jan 2005
    Location
    Bucharest, Romania
    Posts
    5,403

    Default

    Oleg can comment more on the app over at springosgi. OSGi addresses versioning and isolation at generic level, inside one JVM.
    Spring DM, in a similar manner, address Spring and OSGi integration at generic level as well, adding in web support along the way. Pluggable web applications are something more specific, that require some extra design and hooks inside your app.
    It's something that goes beyond Spring DM and OSGi - you can/should use them but that doesn't automatically gives you the features you want.
    To make your app pluggable, you need to change the way you look for features and how resources are found and the content is rendered. Basically, your app needs to be designed in a pluggable way.
    Costin Leau
    SpringSource - http://www.SpringSource.com- Spring Training, Consulting, and Support - "From the Source"
    http://twitter.com/costinl
    Please use [ c o d e ] [ / c o d e ] tags

  5. #5
    Join Date
    Mar 2007
    Posts
    561

    Default

    Quote Originally Posted by MikeNereson View Post
    The question is, can I store web resources, to include jsp, css, javascript, and images within each bundle?[/B] If so, are those bundles wars? Are there any examples of this around the internets?
    Hi Mike,

    have you ever found a solution to this problem?
    Maybe not spring dm?

  6. #6
    Join Date
    Feb 2007
    Location
    New Hampshire
    Posts
    54

    Default

    Nope. Sorry. I never found a solution for this.

  7. #7
    Join Date
    Jan 2005
    Location
    Bucharest, Romania
    Posts
    5,403

    Default

    Guys, take a look at the web slices functionality Rob blogged about here:http://blog.springsource.com/2009/06...source-slices/
    This should address your problem, right?
    Costin Leau
    SpringSource - http://www.SpringSource.com- Spring Training, Consulting, and Support - "From the Source"
    http://twitter.com/costinl
    Please use [ c o d e ] [ / c o d e ] tags

  8. #8
    Join Date
    Mar 2007
    Posts
    561

    Default

    It seems that one needs dm Server for using web slices?

  9. #9
    Join Date
    Jan 2005
    Location
    Bucharest, Romania
    Posts
    5,403

    Default

    Yes, the functionality mentioned in the blog requires dm Server. Note that this is an early prototype.
    Costin Leau
    SpringSource - http://www.SpringSource.com- Spring Training, Consulting, and Support - "From the Source"
    http://twitter.com/costinl
    Please use [ c o d e ] [ / c o d e ] tags

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •