Announcement Announcement Module
Collapse
No announcement yet.
Spring 2.5/Struts 1.3 implementing JAX-RPC Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring 2.5/Struts 1.3 implementing JAX-RPC

    I have a simple question on beans after the integration between Struts/Spring.

    I have an existing project successfully integrated with Spring 2.5.5 and Struts 1.3. I am trying to add a web service based on the Spring/JAX-RPC tutorial, it works fine and managed to get a response. Since the tutorial was based on Spring, the web.xml contains the Axis servlet which point to the endpoint class, the end point class will initialize the applicationcontext and look for the bean. The following are the codes in the endpoint class which initialize the webservice bean.

    Code:
    	protected void onInit() {
    		this.springWS = (IWebServices) getWebApplicationContext().getBean("springWS");
    	}
    As my project has integrated with Struts, the beans are initialized in Struts-config.xml and I there is no ApplicationContext. If I create my own applicationContenxt with springWS bean, it somehow cant read the other beans initialize by Struts at the following:

    Code:
    	<!-- Spring plugin configuration -->
    	<plug-in className="org.springframework.web.struts.ContextLoaderPlugIn">
    		<set-property property="contextConfigLocation"
    			value="/WEB-INF/conf/spring/spring-config.xml" />
    	</plug-in>
    Can any gurus share what is the right way to do this? Am I working on the wrong direction?
    Last edited by onomatopoeia; Oct 28th, 2011, 02:37 AM.
Working...
X