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 Glen Daniels <gd...@macromedia.com> on 2001/10/29 19:01:28 UTC

RE: cvs commit: xml-axis/java/src/org/apache/axis/transport/http AxisServlet.java

Doug, could you explain this a little more?

Where does the .class file end up?  What if the package hierarchy matches an
existing file pattern in the webapp?

I personally would rather see package statements banned from JWS files, as I
think it introduces too many potential complications.  You're already saving
the file under a different extension, and potentially might want to add
deployment info to it - dyking out the package statement doesn't seem that
much of a price to pay.

--Glen

> -----Original Message-----
> From: dug@apache.org [mailto:dug@apache.org]
> Sent: Monday, October 29, 2001 12:43 PM
> To: xml-axis-cvs@apache.org
> Subject: cvs commit: xml-axis/java/src/org/apache/axis/transport/http
> AxisServlet.java
> 
> 
> dug         01/10/29 09:43:24
> 
>   Modified:    java/src/org/apache/axis Constants.java
>                java/src/org/apache/axis/handlers JWSProcessor.java
>                java/src/org/apache/axis/transport/http 
> AxisServlet.java
>   Log:
>   Add support for package names in jws files.
>   The URL will need to include the package name (with / 
> instead of .'s)
>   
>   Revision  Changes    Path
>   1.38      +6 -0      
> xml-axis/java/src/org/apache/axis/Constants.java
>   
>   Index: Constants.java
>   ===================================================================
>   RCS file: 
> /home/cvs/xml-axis/java/src/org/apache/axis/Constants.java,v
>   retrieving revision 1.37
>   retrieving revision 1.38
>   diff -u -r1.37 -r1.38
>   --- Constants.java	2001/10/26 18:18:57	1.37
>   +++ Constants.java	2001/10/29 17:43:24	1.38
>   @@ -179,6 +179,12 @@
>        
> //////////////////////////////////////////////////////////////
> ////////////
>        public static final String URI_DEBUG = 
> "http://xml.apache.org/axis/debug";
>    
>   +    // Absolute path of our home directory (if we can 
> determine one)
>   +    public static final String MC_HOME_DIR = "homeDir" ;
>   +
>   +    // Relative path of the request URL (ie. 
> http://.../axis/a.jws = /a.jws
>   +    public static final String MC_RELATIVE_PATH = "path";
>   +
>        // MessageContext param for the engine's path
>        public static final String MC_REALPATH = "realpath";
>        // MessageContext param for the location of config files
>   
>   
>   
>   1.25      +12 -4     
> xml-axis/java/src/org/apache/axis/handlers/JWSProcessor.java
>   
>   Index: JWSProcessor.java
>   ===================================================================
>   RCS file: 
> /home/cvs/xml-axis/java/src/org/apache/axis/handlers/JWSProces
> sor.java,v
>   retrieving revision 1.24
>   retrieving revision 1.25
>   diff -u -r1.24 -r1.25
>   --- JWSProcessor.java	2001/10/26 14:55:23	1.24
>   +++ JWSProcessor.java	2001/10/29 17:43:24	1.25
>   @@ -133,9 +133,15 @@
>    
>                /* Get the class */
>                /*****************/
>   -            String clsName = f2.getName();
>   -            clsName = clsName.substring( 0, clsName.length()-4 );
>   +            String clsName = null ;
>   +            clsName = 
> msgContext.getStrProp(Constants.MC_RELATIVE_PATH);
>   +            if ( clsName == null ) clsName = f2.getName();
>   +            if ( clsName != null && clsName.charAt(0) == '/' )
>   +                clsName = clsName.substring(1);
>    
>   +            clsName = clsName.substring( 0, clsName.length()-4 );
>   +            clsName = clsName.replace('/', '.');
>   +            
>                if (category.isInfoEnabled())
>                    category.info("ClsName: " + clsName );
>    
>   @@ -164,10 +170,12 @@
>                    // proc.waitFor();
>                    FileOutputStream  out      = new 
> FileOutputStream( errFile );
>                    Main              compiler = new Main( 
> out, "javac" );
>   -                String            outdir   = f1.getParent();
>   +                String            outdir   = null ;
>                    String[]          args     = null ;
>    
>   -                if (outdir == null) outdir=".";
>   +                outdir = msgContext.getStrProp( 
> Constants.MC_HOME_DIR );
>   +                if ( outdir == null ) outdir = f1.getParent();
>   +                if ( outdir == null ) outdir = "." ;
>    
>                    args = new String[] { "-d", outdir,
>                              "-classpath",
>   
>   
>   
>   1.54      +4 -0      
> xml-axis/java/src/org/apache/axis/transport/http/AxisServlet.java
>   
>   Index: AxisServlet.java
>   ===================================================================
>   RCS file: 
> /home/cvs/xml-axis/java/src/org/apache/axis/transport/http/Axi
> sServlet.java,v
>   retrieving revision 1.53
>   retrieving revision 1.54
>   diff -u -r1.53 -r1.54
>   --- AxisServlet.java	2001/10/26 16:09:37	1.53
>   +++ AxisServlet.java	2001/10/29 17:43:24	1.54
>   @@ -145,6 +145,8 @@
>            HandlerRegistry hr = engine.getHandlerRegistry();
>            PrintWriter writer = res.getWriter();
>    
>   +        msgContext.setProperty(Constants.MC_HOME_DIR, 
> context.getRealPath("/"));
>   +
>            String realpath = 
> context.getRealPath(req.getServletPath());
>            String configPath = context.getRealPath("/WEB-INF");
>            if (realpath != null) {
>   @@ -328,6 +330,8 @@
>    
>            /* Save some HTTP specific info in the bag in case 
> a handler needs it */
>            
> /*************************************************************
> *********/
>   +        msgContext.setProperty(Constants.MC_HOME_DIR, 
> context.getRealPath("/"));
>   +        msgContext.setProperty(Constants.MC_RELATIVE_PATH, 
> req.getServletPath());
>            
> msgContext.setProperty(HTTPConstants.MC_HTTP_SERVLET, this );
>            
> msgContext.setProperty(HTTPConstants.MC_HTTP_SERVLETREQUEST, req );
>            
> msgContext.setProperty(HTTPConstants.MC_HTTP_SERVLETRESPONSE, res );
>   
>   
>   
>