You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by ch...@apache.org on 2006/09/24 12:52:01 UTC

svn commit: r449390 - /webservices/axis2/trunk/java/xdocs/1_1/spring.html

Author: chatra
Date: Sun Sep 24 03:52:00 2006
New Revision: 449390

URL: http://svn.apache.org/viewvc?view=rev&rev=449390
Log:
completed review on spring.html

Modified:
    webservices/axis2/trunk/java/xdocs/1_1/spring.html

Modified: webservices/axis2/trunk/java/xdocs/1_1/spring.html
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/xdocs/1_1/spring.html?view=diff&rev=449390&r1=449389&r2=449390
==============================================================================
--- webservices/axis2/trunk/java/xdocs/1_1/spring.html (original)
+++ webservices/axis2/trunk/java/xdocs/1_1/spring.html Sun Sep 24 03:52:00 2006
@@ -2,11 +2,11 @@
 <html>
 <head>
   <meta http-equiv="content-type" content="">
-  <title>Axis2 intergration with the Spring Framework</title>
+  <title>Axis2 integration with the Spring Framework</title>
 </head>
 
-<body>
-<h1>Axis2 Intergration With The Spring Framework</h1>
+<body lang="en">
+<h1>Axis2 Integration With The Spring Framework</h1>
 
 <p>This document is a guide on how to use Axis2 with the Spring Framework</p>
 
@@ -34,36 +34,38 @@
 <h2>Introduction</h2>
 
 <p>The idea behind Axis2 and Spring integration is that Axis2 simply needs to
-have Spring supply one of its pre-loaded beans to the Axis2 Message Receiver
-defined in the AAR services.xml . While Axis2 typically uses reflection to
-instantiate the ServiceClass defined in the services.xml that the Message
-Receiver will use, alternatively one can define a ServiceObjectSupplier that
-will have supply the Object. This guide will show how to use two seperate
-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 any other Spring wired bean. No
-further spring configuration is necessary. These Spring beans can be loaded
-any way desired, as Axis2 has no configuration file dependencies from Spring.
-Spring versions 1.2.6 and 1.2.8 have been tested, but probably any version
-would work as only core functionality is required.</p>
+have Spring supply in one of its pre-loaded beans to the Axis2 Message
+Receiver defined in the AAR services.xml . While Axis2 typically uses
+reflection to instantiate the ServiceClass defined in the services.xml that
+the Message Receiver will use, alternatively one can define a
+ServiceObjectSupplier that will supply the Object.</p>
+
+<p>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
+any other Spring wired bean. No further spring configuration is necessary.
+These Spring beans can be loaded any way desired, as Axis2 has no
+configuration file dependencies from Spring. Spring versions 1.2.6 and 1.2.8
+have been tested, but probably any version would work as only core
+functionality is required.</p>
 
-<p>This guide assumes some basic knowledge of Axis2. See the userguide for
-more info.</p>
+<p>This guide assumes some basic knowledge of Axis2. See the <a
+href="userguide.html">User's Guide</a> for more information.</p>
 <a name="2"></a>
 
-<h2>Configuring Axis2 to be Spring aware</h2>
+<h2>Configuring Axis2 to be Spring Aware</h2>
 <a name="21"></a>
 
 <h3>Programming Model</h3>
 
-<p>From an Axis2 standpoint, two needed hooks are to be placed into the AAR
+<p>From an Axis2 standpoint, two hooks are needed to be placed into the AAR
 services.xml: The ServiceObjectSupplier that hooks Axis2 and Spring together,
 and the name of Spring bean that Axis2 will use as the service. All Message
 Receivers are currently supported, as would be any Message Receiver that
 extends org.apache.axis2.receivers.AbstractMessageReceiver .</p>
 <a name="22"></a>
 
-<h3>Simple Spring config example</h3>
+<h3>Simple Spring Config Example</h3>
 
 <p>For the purpose of this example, and for no other reason besides
 simplicity, we'll configure Spring via a WAR file's web.xml. Lets add a
@@ -84,7 +86,7 @@
 <h3>Inside a Servlet Container</h3>
 
 <p>This 'inside a servlet container' example applicationContext.xml should be
-familair to any Spring user:</p>
+familiar to any Spring user:</p>
 <pre> &lt;?xml version="1.0" encoding="UTF-8"?&gt;
 &lt;!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd"&gt;
 
@@ -101,7 +103,7 @@
   &lt;/bean&gt;
 &lt;/beans&gt;</pre>
 
-<p>If the service is running in a Servlet Container, ie, Axis2 will be able
+<p>If the service is running in a Servlet Container, i.e., Axis2 will be able
 to get a hold of ServletContext, the services.xml for the example would be
 using SpringServletContextObjectSupplier such as:</p>
 <pre> &lt;service name="SpringAwareService"&gt;
@@ -149,7 +151,7 @@
   &lt;/bean&gt;
 &lt;/beans&gt;</pre>
 
-<p>If the service is _NOT_ running in a Servlet Container, ie, Axis2 will
+<p>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
 example would be using SpringAppContextAwareObjectSupplier such as:</p>
 <pre> &lt;service name="SpringAwareService"&gt;
@@ -183,7 +185,7 @@
            ctx.refresh();</pre>
 } <a name="25"></a>
 
-<h3>Putting it all together</h3>
+<h3>Putting It All Together</h3>
 
 <p>From here, its just standard Axis2 coding, only now the service has Spring
 wiring capabilities. The implementation is the same whether using either
@@ -307,25 +309,31 @@
 <p>To run this example, make sure you have the axis2-spring*.jar that comes
 from the axis2-std-*-bin distro in the server side WEB-INF/lib, as well as
 the appropriate Spring jar - most will use the full spring.jar, but the
-minimun requirements are spring-core, spring-beans, spring-context and
+minimum requirements are spring-core, spring-beans, spring-context and
 spring-web. Running the client, you should see this output:</p>
 <pre>Response: &lt;example1:string xmlns:example1="http://springExample.org/example1" 
   xmlns:tns="http://ws.apache.org/axis2"&gt;Spring, emerge thyself&lt;/example1:string&gt;</pre>
 <a name="26"></a>
 
-<h3>Spring inside an AAR</h3>
+<h3>Spring Inside an AAR</h3>
 
 <p>Frequently Axis2 users wish to run Spring inside the AAR. Here we show you
-how. There are four things to be aware of here: (A) You need to configure
-Spring to use the Axis2 Service Classloader. (B) Its up to you to load
-Spring, though we give an example below. (C) For reasons such as classloader
-isolation the SpringAppContextAwareObjectSupplier is the best choice. (D) The
-springframework jar and axis2-spring-*.jar will be placed inside the AAR
-under the lib directory.</p>
+how. There are four points to be aware of here:</p>
+
+<p>(A) You need to configure Spring to use the Axis2 Service Classloader.</p>
+
+<p>(B) Its up to you to load Spring, though we give an example below.</p>
+
+<p>(C) For reasons such as classloader isolation the
+SpringAppContextAwareObjectSupplier is the best choice.</p>
+
+<p>(D) The springframework jar and axis2-spring-*.jar will be placed inside
+the AAR under the lib directory.</p>
 <ul>
-  <li><strong><a name="261"></a>The Spring inside an AAR layout</strong></li>
-</ul>
-<source><pre>./springExample.aar
+  <li><strong><a name="261"></a>The Spring inside an AAR layout</strong>
+    <source>
+    <pre>
+./springExample.aar
 ./META-INF
 ./META-INF/MANIFEST.MF
 ./META-INF/services.xml
@@ -337,20 +345,19 @@
 ./spring/MyBean.class
 ./spring/MyBeanImpl.class
 ./spring/SpringAwareService.class
-./spring/SpringInit.class</pre>
-</source><ul>
-  <li><strong><a name="262"></a>The Spring inside an AAR init
-  class</strong></li>
-</ul>
-
-<p>One way to initialize Spring is to use the
-org.apache.axis2.engine.Service. IMPORTANT: this interface at the time of
-this writing is being discussed for refactoring. We'll update the Spring docs
-ASAP, just be aware that this interface name perhaps will change, though the
-functionality will be probably be in place somewhere. The important part for
-us is the startUp() method and setting Spring to use the Service
-classloader:</p>
-<source><pre>package spring;
+./spring/SpringInit.class
+    </pre>
+    </source></li>
+  <li><strong><a name="262"></a>The Spring inside an AAR init class</strong>
+    <p>One way to initialize Spring is to use the
+    org.apache.axis2.engine.Service. </p>
+    <p>IMPORTANT: this interface at the time of this writing is being
+    discussed for refactoring. We'll update the Spring documents as soon as
+    possible. Be aware that this interface name perhaps will change, though
+    the functionality will probably be in place, somewhere. The important
+    part for us is the startUp() method and setting Spring to use the Service
+    classloader:</p>
+    <source><pre>package spring;
 
 import org.apache.axiom.om.OMElement;
 import org.apache.axis2.engine.Service;
@@ -402,10 +409,9 @@
         }
     }
 }</pre>
-</source>
-<p>Here's the services.xml that now includes SpringInit and the needed
-load-on-startup parameter.</p>
-<source><pre>&lt;serviceGroup&gt;
+    </source><p>Here's the services.xml that now includes SpringInit and the
+    needed load-on-startup parameter.</p>
+    <source><pre>&lt;serviceGroup&gt;
   &lt;service name="SpringInit"&gt;
     &lt;description&gt;
         This is a spring sample Web Service with two operations.
@@ -427,5 +433,7 @@
      &lt;/operation&gt;
   &lt;/service&gt;
 &lt;/serviceGroup&gt;</pre>
+  </li>
+</ul>
 </source></body>
 </html>



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