Announcement Announcement Module
Collapse
No announcement yet.
struts+spring Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    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".

    Comment


    • #3
      Thanks.

      Comment

      Working...
      X