Results 1 to 3 of 3

Thread: struts+spring

Hybrid View

  1. #1
    Join Date
    Aug 2004
    Posts
    15

    Default struts+spring

    Hi,
    I have two submodules in struts application. I have defined the spring contextLoaderPlugIn in each
    submodule sub1-config.xml(default) & sub2-config.xml(/test) file. Also i have two set of beans,each defined in its own
    spring xml file. I was wondering if this is the right way to setup. since i get an error saying, "No bean named
    'test' is defined:..." ,while trying to access the bean in a particular module action class. It finds bean for one module but not for other.
    I see the beans getting loaded for each contextLoaderPlugin?



    <plug-in className="org.springframework.web.struts.ContextL oaderPlugIn">
    <set-property property="contextConfigLocation" value="/WEB-INF/spring/springbean1.xml"/>
    </plug-in>

    <plug-in className="org.springframework.web.struts.ContextL oaderPlugIn">
    <set-property property="contextConfigLocation" value="/WEB-INF/spring/springbean2.xml"/>
    </plug-in>

    Thanks

  2. #2
    Join Date
    Aug 2004
    Location
    St. Louis, MO, USA
    Posts
    24

    Default

    Support for this was added in 1.1 RC 1. Be sure to set the name attribute for the bean to the full path of the action mapping (including the module prefix).
    Code:
    <bean id="testAction" name="test/testAction" class="com.foo.TestAction"/>
    Where you have an action mapping in the sub2-config.xml with a path of "/testAction".

  3. #3
    Join Date
    Aug 2004
    Posts
    15

    Default

    Thanks.

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. Spring managed Struts Actions
    By drc in forum Web
    Replies: 2
    Last Post: Jul 14th, 2005, 10:46 AM
  3. migrating Struts to Spring (long-winded)
    By ocampesato in forum Web
    Replies: 2
    Last Post: May 6th, 2005, 11:17 AM
  4. Replies: 14
    Last Post: Feb 21st, 2005, 05:41 PM
  5. Testing troubles with Struts / Spring
    By anthonyb in forum Web
    Replies: 4
    Last Post: Feb 10th, 2005, 03:44 PM

Posting Permissions

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