Results 1 to 6 of 6

Thread: Multiple Web Module applications

  1. #1
    Join Date
    Nov 2008
    Posts
    2

    Default Multiple Web Module applications

    Hi

    I have question regarding the modularity and scalability of Spring DM Server Web Modules.

    In my company we have a home brewed component model for traditionnel J2EE WAR applications consisting of servlet xml fragments, similar to the ones in Web Modules, and JSP pages located in each of the components. At build time we merge these web.xml servlet XML fragments together as well copy JSP pages from each of our components together in a combined directory structure making up the whole J2EE WAR application. We also compile java source files from each of the components sourcedirectories in one large compilation and place the class files in the classes folder of the WEB-INF directory in the WAR file.

    We would very much like to migrate this home brewed component model for J2EE WAR applications to Spring Web Modules and the Spring/OSGi model in general. The idea was to map each of our existing components to an Spring DM OSGi Web Module, but there seems to be some problems with that approach. We consider our components to be rooted in the same webapplication so they are to contribute servlets and JSP pages to the same context root. By naming convention and the use of subdirectories this is easily handled in our own component model since servlet XML fragments and JSP's are physically copied to the same web.xml file and directory structure for the JSP's.

    We use our component model to scale our development accross several teams and projects to allow them to be able to work in parallel on there individual components and then they meet up in joined applications in our test and production environments.

    We have somewhere around 500 components maintained in appr. 100 projects and combined in appr. 10 applications.

    Have you got any good ideas how something simlar can be accomplished using Web Modules?

    Best regards
    Lars Milland

  2. #2
    Join Date
    Aug 2004
    Location
    Southampton, UK
    Posts
    826

    Default

    Lars,

    It is a known restriction right now that we can't have multiple bundles all contributing static resources (JSPs etc.) to the same servlet context.

    This is a feature that we definitely want to have so we can support use cases like yours.

    In the meantime, what you can do at least is to modularize all your logic into discrete bundles and use your build to unify only the static resource content. If you have a large number of Java classes this will certainly help to simplify your process a lot.

    Regards,

    Rob
    Rob Harrop
    Lead Engineer, dm Server
    SpringSource
    http://www.springsource.com

    Co-Author - Pro Spring

  3. #3
    Join Date
    Jan 2009
    Posts
    3

    Default

    Sorry for dragging up an old thread, but I have a question along similar lines.

    I have a par file which contains two separate web modules (e.g. localhost:8080/fred and localhost:8080/jim) and a common back end (comprising of another seven bundles).

    When everything is deployed separately through the eclipse tools, both web modules work perfectly. When they are deployed within a single par file, the autowiring fails to work in one of my web modules, resulting in a NullPointerException the first time a service is referenced. The other web module still works perfectly.

    Could someone tell me if par files restricted to only including one web module?

  4. #4
    Join Date
    Jan 2009
    Posts
    3

    Default

    Perhaps I should have also mentioned that both web modules are implemented using wicket.

    Thanks in advance,

    Daniel

  5. #5
    Join Date
    Feb 2009
    Posts
    1

    Default

    Hi, Lars,
    I have the same question, and I found one solution, I guess.

    You may try to make yours components as fragment bundles, and create one host war bundle to expose the web application.

    In the war module, declare application context in the XXX-servlet.xml like normal spring mvc application:
    Code:
    <context:component-scan base-package="example.**.web" />
    <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver"
        p:prefix="/WEB-INF/view/" p:suffix=".jsp" />
    And in each fragment bundle, declare host bundle in the manifest file:
    Code:
    ...
    Fragment-Host: dmmvc.war
    Import-Package:
    ...
    create controllers under example.**.web package, they will be scanned and registered in the above web application context when spring framework starts,
    and then place JSP files in the /WEB-INF/view folder.

    But the problem of this solution is, the fragments cannot be stopped at run-time, and maybe not allow multiple versions co-existing, I don't know.

    Best Regards
    xinthink

  6. #6
    Join Date
    Feb 2008
    Posts
    29

    Default

    Hi,


    I'had a similiar question posted on http://forum.springframework.org/sho...679#post229679.

    What I want is to deploy a SWF2 application across various bundles. Is this possible?

    I'm trying to use a single Web Module (which concentrates all xml configuration) that depends on several bundles.

    Theses bundle can be regular java and spring bundle (exporting services) or web resource bundle (exporting webflows, static html and images). My web module is unable to see the resources on other bundles.

    How can I accomplish this? Should I use the MODULE-INF dir on the resources bundle?

    I'm deploying the OSGI application on the Spring dm server, using the Eclipse Tools.


    Thanks in advance,
    Pedro Casagrande

Posting Permissions

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