axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From robertlazar...@apache.org
Subject svn commit: r425533 - /webservices/axis2/trunk/java/xdocs/latest/spring.html
Date Tue, 25 Jul 2006 21:57:59 GMT
Author: robertlazarski
Date: Tue Jul 25 14:57:58 2006
New Revision: 425533

URL: http://svn.apache.org/viewvc?rev=425533&view=rev
Log:
Since someone asked, I put in a section how to load spring's application context in a non-servlet
env

Modified:
    webservices/axis2/trunk/java/xdocs/latest/spring.html

Modified: webservices/axis2/trunk/java/xdocs/latest/spring.html
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/xdocs/latest/spring.html?rev=425533&r1=425532&r2=425533&view=diff
==============================================================================
--- webservices/axis2/trunk/java/xdocs/latest/spring.html (original)
+++ webservices/axis2/trunk/java/xdocs/latest/spring.html Tue Jul 25 14:57:58 2006
@@ -119,6 +119,21 @@
     </operation>
 &lt;/service&gt; </pre>
 
+<p>In a non-servlet container environment, one way you could load the applicationContext.xml
file 
+is in a place that will be run once, upon start-up, execute: </p>
+
+<pre>import org.springframework.context.support.ClassPathXmlApplicationContext;
+
+ public void createSpringAppCtx(ClassLoader cl)
+            throws Exception {
+
+    ClassPathXmlApplicationContext ctx = new
+      ClassPathXmlApplicationContext(new String[] {Constants.MY_PATH +
+      "spring/applicationContext.xml"}, false);
+           ctx.setClassLoader(cl);
+           ctx.refresh();</pre>
+ }
+
 <p>From here, its just standard Axis2 coding, only now the service has Spring wiring
 capabilities. The service is below: </p>
 <pre>package spring;



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


Mime
View raw message