larryi      01/08/15 21:52:56

  Modified:    src/share/org/apache/tomcat/modules/config
                        ContextXmlReader.java
  Log:
  Add rule for "address" parameter on <Host> tag.  It will set a Context's
  hostAddress property.
  
  Revision  Changes    Path
  1.9       +3 -0      
jakarta-tomcat/src/share/org/apache/tomcat/modules/config/ContextXmlReader.java
  
  Index: ContextXmlReader.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/modules/config/ContextXmlReader.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- ContextXmlReader.java     2001/08/06 15:42:36     1.8
  +++ ContextXmlReader.java     2001/08/16 04:52:56     1.9
  @@ -153,6 +153,7 @@
        
        // Virtual host support - if Context is inside a <Host>
        xh.addRule( "Host", xh.setVar( "current_host", "name"));
  +     xh.addRule( "Host", xh.setVar( "current_address", "address"));
        xh.addRule( "Host", xh.setProperties());
        xh.addRule( "Alias", new XmlAction() {
                public void start( SaxContext xctx) throws Exception {
  @@ -171,10 +172,12 @@
                public void end( SaxContext xctx) throws Exception {
                    Context tcCtx=(Context)xctx.currentObject();
                    String host=(String)xctx.getVariable("current_host");
  +                 String address=(String)xctx.getVariable("current_address");
                    Vector aliases=(Vector)xctx.getVariable( "host_aliases" );
                    
                    if( host!=null && ! "DEFAULT".equals( host )) {
                            tcCtx.setHost( host );
  +                         tcCtx.setHostAddress( address );
                            if( aliases!=null ) {
                                Enumeration alE=aliases.elements();
                                while( alE.hasMoreElements() ) {
  
  
  

Reply via email to