Return-Path: Delivered-To: apmail-ws-axis-dev-archive@www.apache.org Received: (qmail 29398 invoked from network); 13 Nov 2006 18:28:36 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 13 Nov 2006 18:28:35 -0000 Received: (qmail 97695 invoked by uid 500); 13 Nov 2006 18:28:45 -0000 Delivered-To: apmail-ws-axis-dev-archive@ws.apache.org Received: (qmail 97451 invoked by uid 500); 13 Nov 2006 18:28:43 -0000 Mailing-List: contact axis-cvs-help@ws.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list axis-cvs@ws.apache.org Received: (qmail 97440 invoked by uid 500); 13 Nov 2006 18:28:43 -0000 Delivered-To: apmail-ws-axis2-cvs@ws.apache.org Received: (qmail 97436 invoked by uid 99); 13 Nov 2006 18:28:43 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 13 Nov 2006 10:28:43 -0800 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 13 Nov 2006 10:28:31 -0800 Received: by eris.apache.org (Postfix, from userid 65534) id E0EC11A9846; Mon, 13 Nov 2006 10:28:00 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r474426 - /webservices/axis2/branches/java/1_1/xdocs/1_1/spring.html Date: Mon, 13 Nov 2006 18:28:00 -0000 To: axis2-cvs@ws.apache.org From: robertlazarski@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20061113182800.E0EC11A9846@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: robertlazarski Date: Mon Nov 13 10:28:00 2006 New Revision: 474426 URL: http://svn.apache.org/viewvc?view=rev&rev=474426 Log: Changing the wording from Servlet Container to a more accurate ServletContext which better reflects the more common Spring inside the AAR in a container scenario Modified: webservices/axis2/branches/java/1_1/xdocs/1_1/spring.html Modified: webservices/axis2/branches/java/1_1/xdocs/1_1/spring.html URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_1/xdocs/1_1/spring.html?view=diff&rev=474426&r1=474425&r2=474426 ============================================================================== --- webservices/axis2/branches/java/1_1/xdocs/1_1/spring.html (original) +++ webservices/axis2/branches/java/1_1/xdocs/1_1/spring.html Mon Nov 13 10:28:00 2006 @@ -18,8 +18,8 @@
  • Programming Model
  • Simple Spring config example
  • -
  • Inside a Servlet Container
  • -
  • Outside a Servlet Container
  • +
  • With a ServletContext
  • +
  • Without a ServletContext
  • Putting it all together
  • Spring inside an AAR
      @@ -43,8 +43,8 @@ ServiceObjectSupplier that will supply the Object.

      This guide will show how to use two separate ServiceObjectSupplier classes -that are part of the Axis2 standard distribution: One for use with a servlet -container, and one without. Once configured, the web service itself acts like +that are part of the Axis2 standard distribution: One for use with a ServletContext, +and one without. Once configured, the web service itself acts like any other Spring wired bean. These Spring beans can be loaded any way desired, as Axis2 has no configuration file dependencies from Spring. Spring versions 1.2.6, 1.2.8 and 2.0 have been tested, but probably any version would @@ -80,13 +80,13 @@ </context-param>

      Next we will show two examples of Spring's /WEB-INF/applicationContext.xml -referenced in the web.xml listener - one with a servlet container, and one +referenced in the web.xml listener - one using a ServletContext, and one without.

      -

      Inside a Servlet Container

      +

      With a ServletContext

      -

      This 'inside a servlet container' example applicationContext.xml should be +

      This 'with a ServletContext' example applicationContext.xml should be familiar to any Spring user:

       <?xml version="1.0" encoding="UTF-8"?>
       <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
      @@ -124,10 +124,10 @@
       org.apache.axis2.receivers.AbstractMessageReceiver .

      -

      Outside a Servlet Container

      +

      Without a ServletContext

      -

      In the case Axis2 can't get a ServletContext, you have the option of -defining a bean that takes advantage of Spring's internal abilities +

      In the case Axis2 can't get a ServletContext, ie another transport or running inside the AAR etc, +you have the option of defining a bean that takes advantage of Spring's internal abilities (ApplicationContextAware interface, specifically) to provide an Application Context to Axis2, with a bean ref 'applicationContext' :

      <?xml version="1.0" encoding="UTF-8"?>
      @@ -153,7 +153,7 @@
       </beans>

      If the service is _NOT_ running in a Servlet Container, i.e., Axis2 will -_NOT_ be able to get a hold of ServletContext, the services.xml for the +_NOT_ be able to get a hold of ServletContext or you prefer not to, the services.xml for the example would be using SpringAppContextAwareObjectSupplier such as:

       <service name="SpringAwareService">
           <description>
      @@ -171,7 +171,7 @@
       would be any Message Receiver that extends
       org.apache.axis2.receivers.AbstractMessageReceiver .

      -

      In a non-servlet container environment, one way you could load the +

      In a 'without a ServletContext' environment, one way you could load the applicationContext.xml file is in a place that will be run once, upon start-up, execute:

      import org.springframework.context.support.ClassPathXmlApplicationContext;
      @@ -265,7 +265,6 @@
       import org.apache.axis2.client.ServiceClient;
       
       public class TestClient {
      -          /** Access point inside the servlet container. **/
           private static EndpointReference targetEPR =
               new EndpointReference(
                      "http://localhost:8080/axis2/services/SpringAwareService");
      @@ -372,7 +371,7 @@
       ./spring/SpringAwareService.class
       ./spring/SpringInit.class 
      -

      As explained in the Outside a Servlet Container section, likewise the +

      As explained in the Without a ServletContext section, likewise the 'Spring inside an AAR' config needs to hook Axis2 and Spring together via a Spring bean. Place the following in your Spring config file:

      
      
      
      ---------------------------------------------------------------------
      To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
      For additional commands, e-mail: axis-cvs-help@ws.apache.org