tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cos...@apache.org
Subject cvs commit: jakarta-tomcat-connectors/jk/java/org/apache/jk/config GeneratorJk1.java GeneratorJk2.java WebXml2Jk.java
Date Wed, 01 May 2002 17:00:19 GMT
costin      02/05/01 10:00:19

  Modified:    jk/java/org/apache/jk/config WebXml2Jk.java
  Added:       jk/java/org/apache/jk/config GeneratorJk1.java
                        GeneratorJk2.java
  Log:
  I believe we now extract _all_ web-server relevant information from web.xml.
  ( including filters, wellcome files, etc ).
  
  Some of it is not yet supported in jk2 ( or jk1 ) - but we can try to
  generate fragments for apache and other servers where this is possible
  ( for example Wellcome files or error pages ).
  
  In time we can add support for those in jk2, but at least for apache
  this is already implemented and it's better to use the existing impl.
  
  Revision  Changes    Path
  1.3       +121 -100  jakarta-tomcat-connectors/jk/java/org/apache/jk/config/WebXml2Jk.java
  
  Index: WebXml2Jk.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/jk/config/WebXml2Jk.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- WebXml2Jk.java	30 Apr 2002 17:55:26 -0000	1.2
  +++ WebXml2Jk.java	1 May 2002 17:00:18 -0000	1.3
  @@ -118,13 +118,6 @@
       String file;
       String worker="lb"; 
   
  -    static final int CONFIG_JK2_URIMAP=1;
  -    
  -    static final int CONFIG_JK_MOUNT=2;
  -    static final int CONFIG_JK_URIWORKER=3;
  -    static final int CONFIG_JK_NSCONFIG=4;
  -    int type;
  -
       // -------------------- Settings -------------------- 
   
       // XXX We can also generate location-independent mappings.
  @@ -173,118 +166,119 @@
           worker=route;
       }
   
  +    // -------------------- Generators --------------------
  +    public static interface MappingGenerator {
  +        void setWebXmlReader(WebXml2Jk wxml );
  +
  +        /** Start section( vhost declarations, etc )
  +         */
  +        void generateStart(PrintWriter out );
  +
  +        void generateEnd(PrintWriter out );
  +        
  +        void generateServletMapping( PrintWriter out,
  +                                     String servlet, String url );
  +        void generateFilterMapping( PrintWriter out, String servlet, String url );
  +
  +        void generateLoginConfig( PrintWriter out, String loginPage,
  +                                  String errPage, String authM );
  +
  +        void generateErrorPage( PrintWriter out, int err, String location );
  +        
  +        void generateMimeMapping( PrintWriter out, String ext, String type );
  +    
  +        void generateWelcomeFiles( PrintWriter out, Vector wf );
  +
  +        void generateConstraints( PrintWriter out, Vector urls, Vector methods, Vector
roles, boolean isSSL );
  +    }    
  +    
       // -------------------- Implementation --------------------
  -    void generateJk2Map(Node webN, PrintWriter out) {
  +    void generate(PrintWriter out, MappingGenerator gen, Node webN ) {
   
  -        System.out.println("Generating mappings for servlets " );
  +        log.info("Generating mappings for servlets " );
           for( Node mapN=getChild( webN, "servlet-mapping" );
                mapN != null; mapN = getNext( mapN ) ) {
               
  -            Node servN=getChild( mapN, "servlet-name");
  -            if( servN==null )
  -                servN=getChild( mapN, "jsp-file");
  -            Node url=getChild( mapN, "url-pattern");
  +            String serv=getChildContent( mapN, "servlet-name");
  +            String url=getChildContent( mapN, "url-pattern");
               
  -            out.println( "[url:" + vhost + cpath + getContent(url) + "]");
  -            out.println( "group=" + worker );
  -            out.println( "#servlet=" +  getContent( servN ));
  -            out.println( "#cpath=" +  cpath );
  -            out.println( "#vhost=" +  vhost );
  -            out.println();
  +            gen.generateServletMapping(  out, serv, url );
           }
   
  -        Node lcN=getChild( webN, "login-config" );
  -        if( lcN!=null ) {
  -            System.out.println("Generating mapping for login-config " );
  +        log.info("Generating mappings for filters " );
  +        for( Node mapN=getChild( webN, "filter-mapping" );
  +             mapN != null; mapN = getNext( mapN ) ) {
               
  -            Node authMethN=getChild( lcN, "auth-method");
  -            String authMeth=getContent( authMethN );
  -            if( authMeth == null ) authMeth="FORM";
  -
  -            Node n1=getChild( lcN, "form-login-config");
  -            String loginPage=getContent( getChild( n1, "form-login-page"));
  -            String errPage=getContent( getChild( n1, "form-error-page"));
  +            String filter=getChildContent( mapN, "filter-name");
  +            String url=getChildContent( mapN, "url-pattern");
   
  -            out.println("[url:" + vhost + cpath + loginPage  + "]" );
  -            out.println( "group=" + worker );
  -            out.println();
  -            out.println("[url:" + vhost + cpath + errPage  + "]" );
  -            out.println( "group=" + worker );
  -            out.println();
  +            gen.generateFilterMapping(  out, filter, url );
           }
   
  -        System.out.println("Generating mappings for security constraints " );
  -        for( Node mapN=getChild( webN, "security-constraint" );
  -             mapN != null; mapN = getNext( mapN )) {
  -            Node wrcN=getChild( mapN, "web-resource-collection");
   
  -            Vector methods=new Vector();
  -            for( Node uN=getChild(wrcN, "http-method");
  -                 uN!=null; uN=getNext( uN )) {
  -                methods.addElement( getContent( uN ));
  -            }
  +        for( Node mapN=getChild( webN, "error-page" );
  +             mapN != null; mapN = getNext( mapN ) ) {
  +            String errorCode= getChildContent( mapN, "error-code" );
  +            String location= getChildContent( mapN, "location" );
   
  -            Vector urls=new Vector();
  -            for( Node uN=getChild(wrcN, "url-pattern");
  -                 uN!=null; uN=getNext( uN )) {
  -                urls.addElement( getContent( uN ));
  +            if( errorCode!=null && ! "".equals( errorCode ) ) {
  +                try {
  +                    int err=new Integer( errorCode ).intValue();
  +                    gen.generateErrorPage( out, err, location );
  +                } catch( Exception ex ) {
  +                    log.error( "Format error " + location, ex);
  +                }
               }
  +        }
   
  -            // Not used at the moment
  -            Node acN=getChild( mapN, "auth-constraint");
  -            Vector roles=new Vector();
  -            for( Node rN=getChild(acN, "role-name");
  -                 rN!=null; rN=getNext( rN )) {
  -                roles.addElement(getContent( rN ));
  +        
  +        Node n0=getChild( webN, "welcome-file-list" );
  +        if( n0!=null ) {
  +            Vector wF=new Vector();
  +            for( Node mapN=getChild( webN, "welcome-file" );
  +                 mapN != null; mapN = getNext( mapN ) ) {
  +                wF.addElement( getContent(mapN));
               }
  -            generateConstraints( urls, methods, roles );
  +            gen.generateWelcomeFiles( out, wF );
           }
  -    }
  -
  -    // To be included in a <VirtualHost> section
  -    void generateJk1Mount(Node webN, PrintWriter out) {
   
  -        System.out.println("Generating JkMount for servlets " );
  -        for( Node mapN=getChild( webN, "servlet-mapping" );
  +        for( Node mapN=getChild( webN, "mime-mapping" );
                mapN != null; mapN = getNext( mapN ) ) {
  -            
  -            Node servN=getChild( mapN, "servlet-name");
  -            if( servN==null )
  -                servN=getChild( mapN, "jsp-file");
  -            Node url=getChild( mapN, "url-pattern");
  -            
  -            out.println( "JkMount " + cpath + getContent(url) + " " + worker);
  -        }
  +            String ext=getChildContent( mapN, "extension" );
  +            String type=getChildContent( mapN, "mime-type" );
   
  +            gen.generateMimeMapping( out, ext, type );
  +        }
  +        
           Node lcN=getChild( webN, "login-config" );
           if( lcN!=null ) {
  -            System.out.println("Generating mapping for login-config " );
  +            log.info("Generating mapping for login-config " );
               
  -            Node authMethN=getChild( lcN, "auth-method");
  -            String authMeth=getContent( authMethN );
  -            if( authMeth == null ) authMeth="FORM";
  +            String authMeth=getContent( getChild( lcN, "auth-method"));
  +            String realm=getContent( getChild( lcN, "realm-name"));
  +            if( authMeth == null ) authMeth="BASIC";
   
               Node n1=getChild( lcN, "form-login-config");
  -            String loginPage=getContent( getChild( n1, "form-login-page"));
  -            String errPage=getContent( getChild( n1, "form-error-page"));
  +            String loginPage= getChildContent( n1, "form-login-page");
  +            String errPage= getChildContent( n1, "form-error-page");
   
  -            out.println("JkMount " + cpath + loginPage  + " " + worker );
  -            out.println("JkMount " + cpath + errPage  + " " + worker );
  -            out.println();
  +            gen.generateLoginConfig( out, loginPage, errPage, authMeth );
           }
   
  -        System.out.println("Generating mappings for security constraints " );
  +        log.info("Generating mappings for security constraints " );
           for( Node mapN=getChild( webN, "security-constraint" );
                mapN != null; mapN = getNext( mapN )) {
  -            Node wrcN=getChild( mapN, "web-resource-collection");
   
               Vector methods=new Vector();
  +            Vector urls=new Vector();
  +            Vector roles=new Vector();
  +            boolean isSSL=false;
  +            
  +            Node wrcN=getChild( mapN, "web-resource-collection");
               for( Node uN=getChild(wrcN, "http-method");
                    uN!=null; uN=getNext( uN )) {
                   methods.addElement( getContent( uN ));
               }
  -
  -            Vector urls=new Vector();
               for( Node uN=getChild(wrcN, "url-pattern");
                    uN!=null; uN=getNext( uN )) {
                   urls.addElement( getContent( uN ));
  @@ -292,25 +286,33 @@
   
               // Not used at the moment
               Node acN=getChild( mapN, "auth-constraint");
  -            Vector roles=new Vector();
               for( Node rN=getChild(acN, "role-name");
                    rN!=null; rN=getNext( rN )) {
                   roles.addElement(getContent( rN ));
               }
  -            generateConstraints( urls, methods, roles );
  -        }
  -    }
   
  +            Node ucN=getChild( mapN, "user-data-constraint");
  +            String transp=getContent(getChild( ucN, "transport-guarantee"));
  +            if( transp!=null ) {
  +                if( "INTEGRAL".equalsIgnoreCase( transp ) ||
  +                    "CONFIDENTIAL".equalsIgnoreCase( transp ) ) {
  +                    isSSL=true;
  +                }
  +            }
  +            for( Node rN=getChild(acN, "role-name");
  +                 rN!=null; rN=getNext( rN )) {
  +                roles.addElement(getContent( rN ));
  +            }
   
  -    public void generateConstraints( Vector urls, Vector methods, Vector roles ) {
  -
  +            gen.generateConstraints( out, urls, methods, roles, isSSL );
  +        }
       }
  -    
  +
       // -------------------- DOM utils --------------------
   
  -        /** Get the content of a node
  -         */
  -    public String getContent(Node n ) {
  +    /** Get the content of a node
  +     */
  +    public static String getContent(Node n ) {
           if( n==null ) return null;
           Node n1=n.getFirstChild();
           // XXX Check if it's a text node
  @@ -321,7 +323,7 @@
       
       /** Get the first child
        */
  -    Node getChild( Node parent, String name ) {
  +    public static Node getChild( Node parent, String name ) {
           Node first=parent.getFirstChild();
           if( first==null ) return null;
           for (Node node = first; node != null;
  @@ -334,9 +336,24 @@
           return null;
       }
   
  +    /** Get the first child's content ( i.e. it's included TEXT node )
  +     */
  +    public static String getChildContent( Node parent, String name ) {
  +        Node first=parent.getFirstChild();
  +        if( first==null ) return null;
  +        for (Node node = first; node != null;
  +             node = node.getNextSibling()) {
  +            //System.out.println("getNode: " + name + " " + node.getNodeName());
  +            if( name.equals( node.getNodeName() ) ) {
  +                return getContent( node );
  +            }
  +        }
  +        return null;
  +    }
  +
       /** Get the node in the list of siblings
        */
  -    Node getNext( Node current ) {
  +    public static Node getNext( Node current ) {
           Node first=current.getNextSibling();
           String name=current.getNodeName();
           if( first==null ) return null;
  @@ -350,7 +367,7 @@
           return null;
       }
   
  -    static class NullResolver implements EntityResolver {
  +    public static class NullResolver implements EntityResolver {
           public InputSource resolveEntity (String publicId,
                                                      String systemId)
               throws SAXException, IOException
  @@ -360,11 +377,11 @@
           }
       }
       
  -    Document readXml(File xmlF)
  +    public static Document readXml(File xmlF)
           throws SAXException, IOException, ParserConfigurationException
       {
           if( ! xmlF.exists() ) {
  -            System.out.println("No xml file " + xmlF );
  +            log.error("No xml file " + xmlF );
               return null;
           }
           DocumentBuilderFactory dbf =
  @@ -410,7 +427,10 @@
                   return;
               }
   
  -            generateJk2Map( webN, out );
  +            MappingGenerator generator=new GeneratorJk2();
  +            
  +            generator.setWebXmlReader( this );
  +            generate( out, generator, webN );
               
   
           } catch( Exception ex ) {
  @@ -419,7 +439,6 @@
       }
   
   
  -
       public static void main(String args[] ) {
           try {
               if( args.length == 1 &&
  @@ -446,5 +465,7 @@
           }
   
       }
  -    
  +
  +    private static org.apache.commons.logging.Log log=
  +        org.apache.commons.logging.LogFactory.getLog( WebXml2Jk.class );
   }
  
  
  
  1.1                  jakarta-tomcat-connectors/jk/java/org/apache/jk/config/GeneratorJk1.java
  
  Index: GeneratorJk1.java
  ===================================================================
  /*
   * ====================================================================
   *
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 1999 The Apache Software Foundation.  All rights
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *    notice, this list of conditions and the following disclaimer.
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   *    notice, this list of conditions and the following disclaimer in
   *    the documentation and/or other materials provided with the
   *    distribution.
   *
   * 3. The end-user documentation included with the redistribution, if
   *    any, must include the following acknowlegement:
   *       "This product includes software developed by the
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowlegement may appear in the software itself,
   *    if and wherever such third-party acknowlegements normally appear.
   *
   * 4. The names "The Jakarta Project", "Tomcat", and "Apache Software
   *    Foundation" must not be used to endorse or promote products derived
   *    from this software without prior written permission. For written
   *    permission, please contact apache@apache.org.
   *
   * 5. Products derived from this software may not be called "Apache"
   *    nor may "Apache" appear in their names without prior written
   *    permission of the Apache Group.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * ====================================================================
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation.  For more
   * information on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   *
   * [Additional notices, if required by prior licensing conditions]
   *
   */
  package org.apache.jk.config;
  
  import java.io.*;
  import java.net.*;
  import java.util.*;
  import java.security.*;
  
  import org.apache.tomcat.util.IntrospectionUtils;
  
  import javax.xml.parsers.*;
  
  /* Yes, it's using DOM */
  import org.w3c.dom.*;
  import org.xml.sax.*;
  
  
  /* Naming conventions:
  
  JK_CONF_DIR == serverRoot/work  ( XXX /jkConfig ? )
  
  - Each vhost has a sub-dir named after the canonycal name
  
  - For each webapp in a vhost, there is a separate WEBAPP_NAME.jkmap
  
  - In httpd.conf ( or equivalent servers ), in each virtual host you
  should "Include JK_CONF_DIR/VHOST/jk_apache.conf". The config
  file will contain the Alias declarations and other rules required
  for apache operation. Same for other servers. 
  
  - WebXml2Jk will be invoked by a config tool or automatically for each
  webapp - it'll generate the WEBAPP.jkmap files and config fragments.
  
  WebXml2Jk will _not_ generate anything else but mappings.
  It should _not_ try to guess locations or anything else - that's
  another components' job.
  
  */
  
  /**
   *
   * @author Costin Manolache
   */
  public class GeneratorJk1 implements WebXml2Jk.MappingGenerator {
      WebXml2Jk wxml;
      String vhost;
      String cpath;
      String worker;
      
      public void setWebXmlReader(WebXml2Jk wxml ) {
          this.wxml=wxml;
          vhost=wxml.vhost;
          cpath=wxml.cpath;
          worker=wxml.worker;
      }
  
      public void generateStart(PrintWriter out ) {
          out.println("# This must be included in the virtual host section for " + vhost );
      }
  
      public void generateEnd(PrintWriter out ) {
  
      }
  
      
      public void generateServletMapping( PrintWriter out, String servlet, String url ) {
          out.println( "JkMount " + cpath + url + " " + worker);
      }
  
      public void generateFilterMapping( PrintWriter out, String servlet, String url ) {
          out.println( "JkMount " + cpath + url + " " + worker);
      }
  
      public void generateLoginConfig( PrintWriter out, String loginPage,
                                          String errPage, String authM ) {
          out.println( "JkMount " + cpath + loginPage + " " + worker);
      }
  
      public void generateErrorPage( PrintWriter out, int err, String location ) {
  
      }
  
      public void generateMimeMapping( PrintWriter out, String ext, String type ) {
  
      }
      
      public void generateWelcomeFiles( PrintWriter out, Vector wf ) {
  
      }
                                              
      
      public void generateConstraints( PrintWriter out, Vector urls, Vector methods, Vector
roles, boolean isSSL ) {
          for( int i=0; i<urls.size(); i++ ) {
              String url=(String)urls.elementAt(i);
  
              out.println( "JkMount " + cpath + url + " " + worker);
          }
      }
  }
  
  
  
  1.1                  jakarta-tomcat-connectors/jk/java/org/apache/jk/config/GeneratorJk2.java
  
  Index: GeneratorJk2.java
  ===================================================================
  /*
   * ====================================================================
   *
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 1999 The Apache Software Foundation.  All rights
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *    notice, this list of conditions and the following disclaimer.
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   *    notice, this list of conditions and the following disclaimer in
   *    the documentation and/or other materials provided with the
   *    distribution.
   *
   * 3. The end-user documentation included with the redistribution, if
   *    any, must include the following acknowlegement:
   *       "This product includes software developed by the
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowlegement may appear in the software itself,
   *    if and wherever such third-party acknowlegements normally appear.
   *
   * 4. The names "The Jakarta Project", "Tomcat", and "Apache Software
   *    Foundation" must not be used to endorse or promote products derived
   *    from this software without prior written permission. For written
   *    permission, please contact apache@apache.org.
   *
   * 5. Products derived from this software may not be called "Apache"
   *    nor may "Apache" appear in their names without prior written
   *    permission of the Apache Group.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * ====================================================================
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation.  For more
   * information on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   *
   * [Additional notices, if required by prior licensing conditions]
   *
   */
  package org.apache.jk.config;
  
  import java.io.*;
  import java.net.*;
  import java.util.*;
  import java.security.*;
  
  import org.apache.tomcat.util.IntrospectionUtils;
  
  import javax.xml.parsers.*;
  
  /* Yes, it's using DOM */
  import org.w3c.dom.*;
  import org.xml.sax.*;
  
  
  /* Naming conventions:
  
  JK_CONF_DIR == serverRoot/work  ( XXX /jkConfig ? )
  
  - Each vhost has a sub-dir named after the canonycal name
  
  - For each webapp in a vhost, there is a separate WEBAPP_NAME.jkmap
  
  - In httpd.conf ( or equivalent servers ), in each virtual host you
  should "Include JK_CONF_DIR/VHOST/jk_apache.conf". The config
  file will contain the Alias declarations and other rules required
  for apache operation. Same for other servers. 
  
  - WebXml2Jk will be invoked by a config tool or automatically for each
  webapp - it'll generate the WEBAPP.jkmap files and config fragments.
  
  WebXml2Jk will _not_ generate anything else but mappings.
  It should _not_ try to guess locations or anything else - that's
  another components' job.
  
  */
  
  /**
   *
   * @author Costin Manolache
   */
  public class GeneratorJk2 implements WebXml2Jk.MappingGenerator {
      WebXml2Jk wxml;
      String vhost;
      String cpath;
      String worker;
      
      public void setWebXmlReader(WebXml2Jk wxml ) {
          this.wxml=wxml;
          vhost=wxml.vhost;
          cpath=wxml.cpath;
          worker=wxml.worker;
      }
  
      public void generateStart(PrintWriter out ) {
          out.println("# Autogenerated from web.xml" );
      }
  
      public void generateEnd(PrintWriter out ) {
  
      }
      public void generateServletMapping( PrintWriter out, String servlet, String url ) {
          out.println( "[url:" + vhost + cpath + url + "]");
          out.println( "group=" + worker );
          out.println( "servlet=" +  servlet);
          out.println();
      }
  
      public void generateFilterMapping( PrintWriter out, String servlet, String url ) {
          out.println( "[url:" + vhost + cpath + url + "]");
          out.println( "group=" + worker );
          out.println( "filter=" +  servlet);
          out.println();
      }
  
      public void generateLoginConfig( PrintWriter out, String loginPage,
                                          String errPage, String authM ) {
          out.println("[url:" + vhost + cpath + loginPage  + "]" );
          out.println( "group=" + worker );
          out.println();
          out.println("[url:" + vhost + cpath + errPage  + "]" );
          out.println( "group=" + worker );
          out.println();
      }
  
      public void generateErrorPage( PrintWriter out, int err, String location ) {
  
      }
  
      public void generateMimeMapping( PrintWriter out, String ext, String type ) {
  
      }
      
      public void generateWelcomeFiles( PrintWriter out, Vector wf ) {
  
      }
                                              
      
      public void generateConstraints( PrintWriter out, Vector urls, Vector methods, Vector
roles, boolean isSSL ) {
          for( int i=0; i<urls.size(); i++ ) {
              String url=(String)urls.elementAt(i);
  
              out.println("[url:" + vhost + cpath + url + "]");
              out.println( "group=" + worker );
              for( int j=0; j<roles.size(); j++ ) {
                  String role=(String)roles.elementAt(i);
                  out.println( "role=" +  role);
              }
              for( int j=0; j<methods.size(); j++ ) {
                  String m=(String)methods.elementAt(i);
                  out.println( "method=" +  m);
              }
              if( isSSL )
                  out.println("ssl=true");
          }
      }
  }
  
  
  

--
To unsubscribe, e-mail:   <mailto:tomcat-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-dev-help@jakarta.apache.org>


Mime
View raw message