Announcement Announcement Module
Collapse
No announcement yet.
Seting up spring in a multimodule application Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Seting up spring in a multimodule application

    Hi, I am working on a legacy web project that consist of multiple module. there is a spring context defined in the web module. I have another module which is just used as a library. Service type class is defined in this lib. I need to use DI within this lib module. What is the best way of doing this also, project is locked in with spring 2.5.6. Thanks in advance.

  • #2
    Hi,

    could you please to be a bit more specific about what's the "service type class defined in this lib", and "use DI withing this lib module"?

    I can't get the whole picture right now, but after understanding the problem, I could help you.

    Best,
    Carlos.

    Comment


    • #3
      Originally posted by cmontemu View Post
      Hi,

      could you please to be a bit more specific about what's the "service type class defined in this lib", and "use DI withing this lib module"?

      I can't get the whole picture right now, but after understanding the problem, I could help you.

      Best,
      Carlos.
      Thanks Carlos,

      I will try my best here. Hopefully it clarify my question.

      I have following modules:

      1. Customer facing front end UI Module (Struts, Java Servlets)
      2. Internal front end UI Module (Spring MVC)
      3. Core Module (J2EE, used by both UI modules, Contains core services, DAO, etc. Has framework defined that can call "service classes" (i.e. service classes defined in other modules (some cases reflections is used to initialize and in others simple "new"))
      4. Custom Services Module (J2EE, service classes are defined here that could be called from "Core Module", or Customer facing UI or even Spring MVC module, This service here could call other services within this module or others <<< This is where I wanted to configure Spring so that I could use DI)

      In addition there are other modules but hopefully above clears the scenario. All these modules are deployed in single Tomcat container. Each of these modules use others as a "library" for instance in above scenario, "Custom Services Module" would be complied into a jar file that will be included as lib in front end UI modules.

      Comment


      • #4
        If you will be using Spring 3.0, then my suggestions would be Java based container configuration. Here you have an example I think is quite close to what you need.

        But you're using an older Spring version, so you'll need to consult this forum in order to deal with it.

        You can start from here and see whether what I told you above is good for you.
        Hopefully somebody else can also give you more assistance.

        Best,
        Carlos

        Comment


        • #5
          Originally posted by cmontemu View Post
          If you will be using Spring 3.0, then my suggestions would be Java based container configuration. Here you have an example I think is quite close to what you need.

          But you're using an older Spring version, so you'll need to consult this forum in order to deal with it.

          You can start from here and see whether what I told you above is good for you.
          Hopefully somebody else can also give you more assistance.

          Best,
          Carlos
          Thanks Carlos for your help.
          I am stuck with Spring 2.5.6 on this project (cannot upgrade to 3 ) I will look into the forum you suggested hopefully I will find a solution soon.

          Comment

          Working...
          X