Results 1 to 3 of 3

Thread: migrating Struts to Spring (long-winded)

  1. #1
    Join Date
    May 2005
    Posts
    2

    Default migrating Struts to Spring (long-winded)

    Hello, everyone:

    I'm trying to determine the what/when/how/why of migrating
    a Struts/Hibernate application to Spring/Hibernate, and
    here's a list of what I've done thus far:

    ++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++
    1) I created an applicationContext.xml file

    2) I created an action-servlet.xml file with definitions
    for each Struts 'action' in struts-config.xml, such as:
    <bean name="/login"
    class="abc.xyz.Login">
    </bean>

    3) I added a 'controller' tag to struts-config.xml:
    <controller>
    <set-property property="processorClass"
    value="org.springframework.web.struts.DelegatingRe questProcessor"/>
    </controller>

    4) I added a 'plug-in' tag to struts-config.xml:
    <plug-in className="org.springframework.web.struts.ContextL oaderPlugIn"/>
    ++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++

    I've deployed the application and I can see that actions
    are delegated to the Spring controller, but obviously it's
    only a very small step in the migration path I'm still
    quite far from the point where I can answer the question,
    "what does this [Spring code] buy us?"

    Do I need to specify the 'forward' elements in the beans
    in action-servlet.xml?

    How do I handle the global 'forward' elements in the
    struts-config.xml file?

    How can I determine whether we ought to do a full
    migration from Struts to Spring, or just integrate
    Struts with Spring?

    In the former case, is there a step-by-step example
    available of how to perform this migration?

    The motivation for our migration from Struts to Spring
    is to leverage JSF for the view layer, Hibernate for
    the persistence layer, and Spring as the "glue" that
    will enable us to add/remove components whenever it's
    deemed necessary to do so.

    Comments/feedback is welcome....

    Regards,

    Oswald

  2. #2
    Join Date
    Aug 2004
    Location
    Melbourne, Australia
    Posts
    1,104

    Default

    I'm trying to determine the what/when/how/why of migrating
    a Struts/Hibernate application to Spring/Hibernate
    Take a look at the JPetStore sample (in the distribution) which can be run using Spring MVC or Struts.

    "what does this [Spring code] buy us?"
    Do you mean Spring vs. non-Spring, or benefits of Spring MVC over Struts? This thread covers a bit of both.

    The motivation for our migration from Struts to Spring...Hibernate for
    the persistence layer
    Spring will work with Struts, so you don't need to remove Struts to use the hibernate-persistence part of Spring.

  3. #3
    Join Date
    May 2005
    Posts
    2

    Default

    Thanks for the feedback, and I'll look at the PetStore code.
    Since all the people in my company who are involved in
    web development are familiar with Struts, they want to see
    tangible/convincing evidence that Spring will simplify their
    daily work (i.e., more than Spring Is A Good Thing), after
    which I'm sure they will make the effort to learn Spring.

    It seems to me that a "fusion" of Spring and Struts, which
    entails maintaining the three XML files struts-config.xml,
    action-servlet.xml, and applicationContext.xml is a only
    a mechanism by which Spring can be introduced as a
    "glue" component (and similarly for the Hibernate side).

    In other words, if we replace our current Struts/Hibernate
    combination with a Spring/Hibernate combination whereby
    we define our Struts actions as Spring beans in the
    action-servlet.xml file, this change along does not provide
    any significant savings in development time.

    I need to determine how much change is needed to our
    code base (and how much effort required to do so) in
    order to be able to say to our developers, "this is what
    we need to do, how to do it, and this is how/why it will
    save us work", sort of analogous to persuading people
    to migrate from Struts to JSF

    Regards,

    Oswald

Similar Threads

  1. Spring MVC Web Framework versus Struts
    By biguniverse in forum Web Flow
    Replies: 27
    Last Post: Aug 29th, 2012, 03:57 AM
  2. Replies: 2
    Last Post: Sep 22nd, 2005, 04:11 PM
  3. Replies: 14
    Last Post: Feb 21st, 2005, 05:41 PM
  4. Testing troubles with Struts / Spring
    By anthonyb in forum Web
    Replies: 4
    Last Post: Feb 10th, 2005, 03:44 PM
  5. Replies: 16
    Last Post: Nov 19th, 2004, 09:36 AM

Posting Permissions

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