You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ak...@hyperreal.org on 1999/11/13 01:50:38 UTC

cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/deployment TagLibConfig.java TagLibConfigImpl.java AuthorizationConstraint.java Constants.java WebApplicationDescriptor.java WebApplicationDescriptorImpl.java WebApplicationReader.java WebDescriptorFactoryImpl.java web.dtd

akv         99/11/12 16:50:37

  Modified:    src/share/org/apache/tomcat/deployment
                        AuthorizationConstraint.java Constants.java
                        WebApplicationDescriptor.java
                        WebApplicationDescriptorImpl.java
                        WebApplicationReader.java
                        WebDescriptorFactoryImpl.java web.dtd
  Added:       src/share/org/apache/tomcat/deployment TagLibConfig.java
                        TagLibConfigImpl.java
  Log:
  cvs update -j TOMCAT_J2EE_10F_102199 src/share/org/apache/tomcat/deployment.
  
  NOTE: Harish, Craig, there was a conflict in UserDataConstraint.java which
  one of you should probably look into. (on a jakarta-tomcat modulde checked out of
  the trunk try: cd src/share/org/apache/tomcat/deployment; cvs update -j
  TOMCAT_J2EE_10F_102199 UserDataConstraint.java.
  
  Revision  Changes    Path
  1.3       +0 -6      jakarta-tomcat/src/share/org/apache/tomcat/deployment/AuthorizationConstraint.java
  
  Index: AuthorizationConstraint.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/deployment/AuthorizationConstraint.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- AuthorizationConstraint.java	1999/10/31 00:09:51	1.2
  +++ AuthorizationConstraint.java	1999/11/13 00:50:21	1.3
  @@ -1,10 +1,4 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/deployment/AuthorizationConstraint.java,v 1.2 1999/10/31 00:09:51 craigmcc Exp $
  - * $Revision: 1.2 $
  - * $Date: 1999/10/31 00:09:51 $
  - *
  - * ====================================================================
  - *
    * The Apache Software License, Version 1.1
    *
    * Copyright (c) 1999 The Apache Software Foundation.  All rights 
  
  
  
  1.2       +4 -6      jakarta-tomcat/src/share/org/apache/tomcat/deployment/Constants.java
  
  Index: Constants.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/deployment/Constants.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Constants.java	1999/10/09 00:20:41	1.1
  +++ Constants.java	1999/11/13 00:50:23	1.2
  @@ -1,10 +1,4 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/deployment/Constants.java,v 1.1 1999/10/09 00:20:41 duncan Exp $
  - * $Revision: 1.1 $
  - * $Date: 1999/10/09 00:20:41 $
  - *
  - * ====================================================================
  - * 
    * The Apache Software License, Version 1.1
    *
    * Copyright (c) 1999 The Apache Software Foundation.  All rights 
  @@ -149,6 +143,10 @@
       public static String FORM_LOGIN_CONFIG = "form-login-config";
       public static String FORM_LOGIN_PAGE = "form-login-page";
       public static String FORM_ERROR_PAGE = "form-error-page";
  +
  +    public static final String TAGLIB = "taglib";
  +    public static final String TAGLIB_URI = "taglib-uri";
  +    public static final String TAGLIB_LOCATION = "taglib-location";
   
   
       public static final String JakartaWebApplication =
  
  
  
  1.2       +9 -7      jakarta-tomcat/src/share/org/apache/tomcat/deployment/WebApplicationDescriptor.java
  
  Index: WebApplicationDescriptor.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/deployment/WebApplicationDescriptor.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- WebApplicationDescriptor.java	1999/10/09 00:20:46	1.1
  +++ WebApplicationDescriptor.java	1999/11/13 00:50:26	1.2
  @@ -1,10 +1,4 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/deployment/WebApplicationDescriptor.java,v 1.1 1999/10/09 00:20:46 duncan Exp $
  - * $Revision: 1.1 $
  - * $Date: 1999/10/09 00:20:46 $
  - *
  - * ====================================================================
  - *
    * The Apache Software License, Version 1.1
    *
    * Copyright (c) 1999 The Apache Software Foundation.  All rights 
  @@ -114,8 +108,16 @@
       
       public LoginConfiguration getLoginConfiguration();
       public void setLoginConfiguration(LoginConfiguration loginConfiguration);
  -    // XXXX missing from DTD ?
  +
  +    /** Get all the TLD location/uri mappings. */
  +    public Enumeration getTagLibConfigs();
  +    public void addTagLibConfig(TagLibConfig tldConfig);
  +    
  +    // XXX
  +    // commented out in anticipation they'll eventually be supported
  +/*
       public Enumeration getLocalizedContentDescriptors();
       public void addLocalizedContentDescriptor(LocalizedContentDescriptor localizedContentDescriptor);
  +*/
   }
   
  
  
  
  1.2       +25 -6     jakarta-tomcat/src/share/org/apache/tomcat/deployment/WebApplicationDescriptorImpl.java
  
  Index: WebApplicationDescriptorImpl.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/deployment/WebApplicationDescriptorImpl.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- WebApplicationDescriptorImpl.java	1999/10/09 00:20:46	1.1
  +++ WebApplicationDescriptorImpl.java	1999/11/13 00:50:26	1.2
  @@ -1,10 +1,4 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/deployment/WebApplicationDescriptorImpl.java,v 1.1 1999/10/09 00:20:46 duncan Exp $
  - * $Revision: 1.1 $
  - * $Date: 1999/10/09 00:20:46 $
  - *
  - * ====================================================================
  - *
    * The Apache Software License, Version 1.1
    *
    * Copyright (c) 1999 The Apache Software Foundation.  All rights 
  @@ -70,6 +64,7 @@
   /**
    *
    * @author James Todd [gonzo@eng.sun.com]
  + * @author Anil K. Vijendran [akv@eng.sun.com] -- added support for taglib in web.xml
    */
   
   public class WebApplicationDescriptorImpl
  @@ -86,7 +81,13 @@
       private Vector resourceReferences = new Vector();
       private Vector securityRoles = new Vector();
       private Vector securityConstraints = new Vector();
  +    private Vector tldConfigs = new Vector();
  +    
  +    // XXX
  +    // commented out in anticipation they'll eventually be supported 
  +/*
       private Vector localizedContentDescriptors = new Vector();
  +*/
       private LoginConfiguration loginConfiguration;
       private Vector environmentEntries;
       
  @@ -180,6 +181,9 @@
           securityConstraints.addElement(securityConstraint);
       }
       
  +    // XXX
  +    // commented out in anticipation they'll eventually be supported 
  +/*
       public Enumeration getLocalizedContentDescriptors() {
   	return localizedContentDescriptors.elements();
       }
  @@ -189,6 +193,7 @@
   	this.localizedContentDescriptors.addElement(
   	    localizedContentDescriptor);
       }
  +*/
       
       public LoginConfiguration getLoginConfiguration() {
   	return this.loginConfiguration;
  @@ -211,6 +216,14 @@
       public void addEnvironmentEntry(EnvironmentEntry environmentEntry) {
   	this.getEnvironmentEntryVector().addElement(environmentEntry);
       }
  +
  +    public Enumeration getTagLibConfigs() {
  +        return tldConfigs.elements();
  +    }
  +    
  +    public void addTagLibConfig(TagLibConfig tldConfig) {
  +        tldConfigs.addElement(tldConfig);
  +    }
       
       public String toString() {
   	String s = "Web App Descriptor ";
  @@ -226,9 +239,15 @@
   	s = s + " \n resourceReferences" + resourceReferences;
   	s = s + " \n securityRoles" + securityRoles;
   	s = s + " \n securityConstraints" + securityConstraints;
  +
  +      // XXX
  +      // commented out in anticipation they'll eventually be supported 
  +/*
   	s = s + " \n localizedContentDescriptors" + localizedContentDescriptors;
  +*/
   	s = s + " \n loginConfiguration " + loginConfiguration;
   	s = s + " \n environmentEntries " + environmentEntries;
  +        s = s + " \n tldConfigs " + tldConfigs;
   
   	return s;
       }
  
  
  
  1.2       +20 -7     jakarta-tomcat/src/share/org/apache/tomcat/deployment/WebApplicationReader.java
  
  Index: WebApplicationReader.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/deployment/WebApplicationReader.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- WebApplicationReader.java	1999/10/09 00:20:46	1.1
  +++ WebApplicationReader.java	1999/11/13 00:50:27	1.2
  @@ -1,10 +1,4 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/deployment/WebApplicationReader.java,v 1.1 1999/10/09 00:20:46 duncan Exp $
  - * $Revision: 1.1 $
  - * $Date: 1999/10/09 00:20:46 $
  - *
  - * ====================================================================
  - *
    * The Apache Software License, Version 1.1
    *
    * Copyright (c) 1999 The Apache Software Foundation.  All rights 
  @@ -145,12 +139,17 @@
   		processSecurityRoles();
   		processEnvironmentEntries();    
   		processEjbReferences();
  +                processTagLibConfigs();
   	    } else {
   	        String msg = "parsing error";
   
   		throw new IllegalStateException(msg);
   	    }
   
  +            // FIXME: Anil, remove this when you are done - akv
  +            // System.err.println("Printing the web application descriptor: ");
  +            // System.err.println(webApplicationDescriptor.toString());
  +            
   	    return webApplicationDescriptor;
   	} catch (Throwable t) {
   	    String msg = "parsing error: " + t.getMessage();
  @@ -221,6 +220,19 @@
   	    this.webApplicationDescriptor.addContextParameter(param);
   	 }
       }
  +
  +
  +    private void processTagLibConfigs() {
  +        Enumeration enum = this.config.elements(Constants.TAGLIB);
  +        while (enum.hasMoreElements()) {
  +            XMLTree next = (XMLTree) enum.nextElement();
  +            TagLibConfig config 
  +                = (TagLibConfig) this.factory.createDescriptor(TagLibConfig.class);
  +            config.setTagLibURI(next.getFirstElement(Constants.TAGLIB_URI).getValue());
  +            config.setTagLibLocation(next.getFirstElement(Constants.TAGLIB_LOCATION).getValue());
  +            this.webApplicationDescriptor.addTagLibConfig(config);
  +        }
  +    }
       
        private void processErrorPages() {
   	 Enumeration enum = this.config.elements(Constants.ERROR_PAGE);
  @@ -561,9 +573,9 @@
   	}
   	throw new RuntimeException("There is no web component by the name of " + name + " here.");
       }
  +
       
       
  -
       private Vector parseServlets(Enumeration servlets,
           Enumeration servletMaps) {
           Vector webComponentDescriptors = new Vector();
  @@ -718,4 +730,5 @@
   	
   	return sessionTimeOut.intValue();
       }
  +
   }
  
  
  
  1.2       +3 -6      jakarta-tomcat/src/share/org/apache/tomcat/deployment/WebDescriptorFactoryImpl.java
  
  Index: WebDescriptorFactoryImpl.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/deployment/WebDescriptorFactoryImpl.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- WebDescriptorFactoryImpl.java	1999/10/09 00:20:46	1.1
  +++ WebDescriptorFactoryImpl.java	1999/11/13 00:50:28	1.2
  @@ -1,10 +1,4 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/deployment/WebDescriptorFactoryImpl.java,v 1.1 1999/10/09 00:20:46 duncan Exp $
  - * $Revision: 1.1 $
  - * $Date: 1999/10/09 00:20:46 $
  - *
  - * ====================================================================
  - *
    * The Apache Software License, Version 1.1
    *
    * Copyright (c) 1999 The Apache Software Foundation.  All rights 
  @@ -116,6 +110,9 @@
               WebResourceCollection.class, WebResourceCollectionImpl.class);
   	this.interfaceToImplementationMap.put(ResourceReference.class,
               ResourceReferenceImpl.class);
  +
  +        this.interfaceToImplementationMap.put(TagLibConfig.class, 
  +                                              TagLibConfigImpl.class);
       }
   
       public Object createDescriptor(Class interfaceType) {
  
  
  
  1.6       +4 -13     jakarta-tomcat/src/share/org/apache/tomcat/deployment/web.dtd
  
  Index: web.dtd
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/deployment/web.dtd,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- web.dtd	1999/10/26 18:37:48	1.5
  +++ web.dtd	1999/11/13 00:50:29	1.6
  @@ -121,12 +121,12 @@
   <!ELEMENT mime-mapping (extension, mime-type)>
   
   <!-- The extension element contains a string describing an
  -extension. example: �txt� -->
  +extension. example: txt -->
   
   <!ELEMENT extension (#PCDATA)>
   
   <!-- The mime-type element contains a defined mime type. example:
  -�text/plain� -->
  +text/plain -->
   
   <!ELEMENT mime-type (#PCDATA)>
   
  @@ -296,17 +296,6 @@
   <!-- The role-name element contains the name of a role. This element
   must contain a non-empty string. -->
   
  -<!-- XXX
  -     this causes validation errors
  -<!ELEMENT role-name (#PCDATA)>
  --->
  -
  -<!-- The security-role-ref element contains the declaration of a
  -security role reference in the servlet's code. The contents of the
  -role-name element is that of the String used in the servlet code to
  -specify a role. The role-link element specifies that this coded role
  -should be linked to a role described by the security-role element -->
  -
   <!ELEMENT security-role-ref (description?, role-name, role-link)> 
   
   <!-- The role-link element is used to link a security role reference
  @@ -446,3 +435,5 @@
   <!ATTLIST home id ID #IMPLIED>
   <!ATTLIST remote id ID #IMPLIED>
   <!ATTLIST ejb-link id ID #IMPLIED>
  +
  +
  
  
  
  1.2       +70 -0     jakarta-tomcat/src/share/org/apache/tomcat/deployment/TagLibConfig.java
  
  
  
  
  1.2       +72 -0     jakarta-tomcat/src/share/org/apache/tomcat/deployment/TagLibConfigImpl.java