You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by Dan Rapp <Da...@whizbang.com> on 2002/01/08 00:05:41 UTC

Suggested change to AxisServlet

I'm using Axis in an environment where we sometimes use Jetty instead of
Apache Tomcat. Jetty supports execution of web applications directly out
of the Web Application Archive rather than extracting the app to a
directory. I've encountered a minor problem with Axis in this
environment that has a simple work around.
 
Following is that patch that will allow configuration load in this
environment.
 
--Dan Rapp
 
Index: java/src/org/apache/axis/transport/http/AxisServlet.java
===================================================================
RCS file:
/home/cvspublic/xml-axis/java/src/org/apache/axis/transport/http/AxisSer
vlet.java,v
retrieving revision 1.70
diff -u -r1.70 AxisServlet.java
--- java/src/org/apache/axis/transport/http/AxisServlet.java    12 Dec
2001 18:17:52 -0000      1.70
+++ java/src/org/apache/axis/transport/http/AxisServlet.java    7 Jan
2002 22:55:19 -0000
@@ -135,12 +135,12 @@
 
     public AxisServer getEngine() throws AxisFault {
         if (getServletContext().getAttribute("AxisEngine") == null) {
-            String webInfPath =
getServletContext().getRealPath("/WEB-INF");
             // Set the base path for the AxisServer to our WEB-INF
directory
             // (so the config files can't get snooped by a browser)
             FileProvider provider =
-                    new FileProvider(webInfPath,
-                                     Constants.SERVER_CONFIG_FILE);
+                    new
FileProvider(getServletContext().getResourceAsStream(
+                                     "/WEB-INF/"+
+                                     Constants.SERVER_CONFIG_FILE));
 
             Map environment = new HashMap();
             environment.put("servletContext", getServletContext());