craigmcc    00/10/28 17:35:07

  Modified:    catalina/src/conf web_23.dtd
               catalina/src/share/org/apache/catalina Context.java
               catalina/src/share/org/apache/catalina/authenticator
                        AuthenticatorBase.java
               catalina/src/share/org/apache/catalina/core
                        StandardContext.java
               catalina/src/share/org/apache/catalina/deploy
                        ContextResource.java SecurityConstraint.java
               catalina/src/share/org/apache/catalina/startup
                        ContextConfig.java
               webapps/examples/WEB-INF web.xml
  Log:
  Reflect a variety of changes in the deployment descriptor that are
  published in Servlet 2.3 Proposed Final Draft (PFD):
  - New <resource-env-ref> element
  - New <res-sharing-scope> subelement for the <resource-ref> element
  - Various documentation updates and clarifications in the DTD itself
  
  Revision  Changes    Path
  1.2       +83 -24    jakarta-tomcat-4.0/catalina/src/conf/web_23.dtd
  
  Index: web_23.dtd
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/conf/web_23.dtd,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- web_23.dtd        2000/08/19 20:36:48     1.1
  +++ web_23.dtd        2000/10/29 00:35:03     1.2
  @@ -11,8 +11,8 @@
   context-param*, filter*, filter-mapping*, listener*,
   servlet*, servlet-mapping*, session-config?,
   mime-mapping*, welcome-file-list?, error-page*, taglib*,
  -resource-ref*, security-constraint*, login-config?, security-role*,
  -env-entry*, ejb-ref*)>
  +resource-env-ref*, resource-ref*, security-constraint*,
  +login-config?, security-role*, env-entry*, ejb-ref*)>
   
   <!-- Declares a filter in the web application deployment descriptor.
   The filter is mapped to either a servlet or a URL pattern in the
  @@ -33,7 +33,7 @@
   <!ELEMENT filter-class (#PCDATA)>
   
   <!-- Declaration of the filter mappings in this web application.
  -The conatiner used the filter-mapping declarations to decide which
  +The conatiner uses the filter-mapping declarations to decide which
   filters to apply to a request, and in what order.  The container
   matches the request URI to a Servlet in the normal way.  To determine
   which filters to apply it matches filter-mapping declarations either
  @@ -109,7 +109,8 @@
   servlet. If a jsp-file is specified and the load-on-startup element is
   present, then the JSP should be precompiled and loaded. -->
   
  -<!ELEMENT servlet (icon?, servlet-name, display-name?, description?, 
(servlet-class|jsp-file), init-param*, load-on-startup?, security-role-ref*)>
  +<!ELEMENT servlet (icon?, servlet-name, display-name?, description?,
  +(servlet-class|jsp-file), init-param*, load-on-startup?, security-role-ref*)>
   
   <!-- The servlet-name element contains the canonical name of the
   servlet. -->
  @@ -122,7 +123,7 @@
   <!ELEMENT servlet-class (#PCDATA)>
   
   <!-- The jsp-file element contains the full path to a JSP file within
  -the web application. -->
  +the web application beginning with a '/'. -->
   
   <!ELEMENT jsp-file (#PCDATA)>
   
  @@ -147,7 +148,7 @@
   <!ELEMENT servlet-mapping (servlet-name, url-pattern)>
   
   <!-- The url-pattern element contains the url pattern of the
  -mapping. Must follow the rules specified in Section 10 of the Servlet
  +mapping. Must follow the rules specified in Section 11.2 of the Servlet
   API Specification. -->
   
   <!ELEMENT url-pattern (#PCDATA)>
  @@ -169,12 +170,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)>
   
  @@ -223,10 +224,37 @@
   
   <!ELEMENT location (#PCDATA)>
   
  +<!-- The resource-env-ref element contains a declaration of a component's
  +reference to an administered object associated with a resource in the
  +component's environment.  It consists of an optional description, the
  +resource environment reference name, and an indication of the resource
  +environment reference type expected by the component's code.  Examples:
  +  <resource-env-ref>
  +    <resource-env-ref-name>jms/StockQueue</resource-env-ref-name>
  +    <resource-env-ref-type>javax.jms.Queue</resource-env-ref-type>
  +  </resource-env-ref>
  +-->
  +
  +<!ELEMENT resource-env-ref (description?, resource-env-ref-name,
  +resource-env-ref-type)>
  +
  +<!-- The resource-env-ref-name element specifies the name of a
  +resource environment reference; its value is the environment entry
  +name used in code. -->
  +
  +<!ELEMENT resource-env-ref-name (#PCDATA)>
  +
  +<!-- The resource-env-ref-type element specifies the type of a
  +resource environment reference.  Web containers in J2EE are requird
  +to support javax.jms.Topic and javax.jms.Queue. -->
  +
  +<!ELEMENT resource-env-ref-type (#PCDATA)>
  +
   <!-- The resource-ref element contains a declaration of a Web
   Application's reference to an external resource. -->
   
  -<!ELEMENT resource-ref (description?, res-ref-name, res-type, res-auth)>
  +<!ELEMENT resource-ref (description?, res-ref-name, res-type, res-auth,
  +res-sharing-scope?)>
   
   <!-- The res-ref-name element specifies the name of the resource
   factory reference name. -->
  @@ -241,14 +269,27 @@
   <!-- The res-auth element indicates whether the application component
   code performs resource signon programmatically or whether the
   container signs onto the resource based on the principle mapping
  -information supplied by the deployer. Must be CONTAINER or SERVLET -->
  +information supplied by the deployer. The allowed values are
  +  <res-auth>Application</res-auth>
  +  <res-auth>Container</res-auth>
  +for those respective cases. -->
   
   <!ELEMENT res-auth (#PCDATA)>
   
  +<!-- The res-sharing-scope element specifies whether connections
  +obtained through the given resource manager connection factory
  +reference can be shared.  The value of this element, if specified,
  +must be one of the two following:
  +  <res-sharing-scope>Shareable</res-sharing-scope>
  +  <res-sharing-scope>Unshareable</res-sharing-scope>
  +The default value is Shareable. -->
  +
  +<!ELEMENT res-sharing-scope (#PCDATA)>
  +
   <!-- The security-constraint element is used to associate security
   constraints with one or more web resource collections -->
   
  -<!ELEMENT security-constraint (web-resource-collection+,
  +<!ELEMENT security-constraint (display-name?, web-resource-collection+,
   auth-constraint?, user-data-constraint?)>
   
   <!-- The web-resource-collection element is used to identify a subset
  @@ -289,7 +330,10 @@
   
   <!-- The auth-constraint element indicates the user roles that should
   be permitted access to this resource collection. The role used here
  -must appear in a security-role-ref element. -->
  +must either appear in a security-role-ref element, or be the specially
  +reserved role-name "*" that is a compact syntax for indicating all
  +roles in the web application.  If both "*" and rolenames appear, the
  +container interprets this as all roles. -->
   
   <!ELEMENT auth-constraint (description?, role-name*)>
   
  @@ -341,8 +385,19 @@
   
   <!ELEMENT security-role (description?, role-name)>
   
  -<!-- The role-name element contains the name of a role. This element
  -must contain a non-empty string. -->
  +<!-- The security-role-ref element defines a mapping between the name
  +of a role called from a Servlet using isUserInRole(String name) and the
  +name of a security role defined for the web application.  For example,
  +to map the security role reference "FOO" to the security role with the
  +role-name "manager", the syntax would be:
  +  <security-role-ref>
  +    <role-name>FOO</role-name>
  +    <role-link>manager</role-link>
  +  </security-role-ref>
  +In this case if the servlet called by a user belonging to the "manager"
  +security role made the API call isUserInRole("FOO") the result would be true.
  +Since the role-name "*" has a special meaning for authorization constraints,
  +its value is not permitted here. -->
   
   <!ELEMENT security-role-ref (description?, role-name, role-link)> 
   
  @@ -382,7 +437,7 @@
   enterprise bean.  -->
   
   <!ELEMENT ejb-ref (description?, ejb-ref-name, ejb-ref-type, home,
  -remote, ejb-link?, runAs?)>
  +remote, ejb-link?, run-as?)>
   
   <!-- The ejb-ref-name element contains the name of an EJB
   reference. This is the JNDI name that the servlet code uses to get a
  @@ -416,7 +471,7 @@
   <!-- The runAs element must contain the name of a security role
   defined for this web application. -->
   
  -<!ELEMENT runAs (#PCDATA)>
  +<!ELEMENT run-as (#PCDATA)>
   
   <!-- The ID mechanism is to allow tools to easily make tool-specific
   references to the elements of the deployment descriptor. This allows
  @@ -457,14 +512,21 @@
   <!ATTLIST mime-type id ID #IMPLIED>
   <!ATTLIST welcome-file-list id ID #IMPLIED>
   <!ATTLIST welcome-file id ID #IMPLIED>
  +<!ATTLIST taglib id ID #IMPLIED>
  +<!ATTLIST taglib-uri id ID #IMPLIED>
  +<!ATTLIST taglib-location id ID #IMPLIED>
   <!ATTLIST error-page id ID #IMPLIED>
   <!ATTLIST error-code id ID #IMPLIED>
   <!ATTLIST exception-type id ID #IMPLIED>
   <!ATTLIST location id ID #IMPLIED>
  +<!ATTLIST resource-env-ref id ID #IMPLIED>
  +<!ATTLIST resource-env-ref-name id ID #IMPLIED>
  +<!ATTLIST resource-env-ref-type id ID #IMPLIED>
   <!ATTLIST resource-ref id ID #IMPLIED>
   <!ATTLIST res-ref-name id ID #IMPLIED>
   <!ATTLIST res-type id ID #IMPLIED>
   <!ATTLIST res-auth id ID #IMPLIED>
  +<!ATTLIST res-sharing-scope id ID #IMPLIED>
   <!ATTLIST security-constraint id ID #IMPLIED>
   <!ATTLIST web-resource-collection id ID #IMPLIED>
   <!ATTLIST web-resource-name id ID #IMPLIED>
  @@ -473,14 +535,12 @@
   <!ATTLIST transport-guarantee id ID #IMPLIED>
   <!ATTLIST auth-constraint id ID #IMPLIED>
   <!ATTLIST role-name id ID #IMPLIED>
  -<!ATTLIST auth-method id ID #IMPLIED>
  -<!ATTLIST basic-auth id ID #IMPLIED>
  -<!ATTLIST form-auth id ID #IMPLIED>
  +<!ATTLIST login-config id ID #IMPLIED>
  +<!ATTLIST realm-name id ID #IMPLIED>
  +<!ATTLIST form-login-config id ID #IMPLIED>
   <!ATTLIST form-login-page id ID #IMPLIED>
   <!ATTLIST form-error-page id ID #IMPLIED>
  -<!ATTLIST form-login-config id ID #IMPLIED>
  -<!ATTLIST realm-name id ID #IMPLIED>
  -<!ATTLIST login-config id ID #IMPLIED>
  +<!ATTLIST auth-method id ID #IMPLIED>
   <!ATTLIST security-role id ID #IMPLIED>
   <!ATTLIST security-role-ref id ID #IMPLIED>
   <!ATTLIST role-link id ID #IMPLIED>
  @@ -488,12 +548,11 @@
   <!ATTLIST env-entry-name id ID #IMPLIED>
   <!ATTLIST env-entry-value id ID #IMPLIED>
   <!ATTLIST env-entry-type id ID #IMPLIED>
  -<!ATTLIST mutual-auth id ID #IMPLIED>
   <!ATTLIST ejb-ref id ID #IMPLIED>
   <!ATTLIST ejb-ref-name id ID #IMPLIED>
   <!ATTLIST ejb-ref-type id ID #IMPLIED>
   <!ATTLIST home id ID #IMPLIED>
   <!ATTLIST remote id ID #IMPLIED>
   <!ATTLIST ejb-link id ID #IMPLIED>
  -<!ATTLIST runAs iid ID #IMPLIED>
  +<!ATTLIST run-as iid ID #IMPLIED>
   
  
  
  
  1.12      +30 -4     
jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/Context.java
  
  Index: Context.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/Context.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- Context.java      2000/10/21 13:30:32     1.11
  +++ Context.java      2000/10/29 00:35:04     1.12
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/Context.java,v 
1.11 2000/10/21 13:30:32 craigmcc Exp $
  - * $Revision: 1.11 $
  - * $Date: 2000/10/21 13:30:32 $
  + * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/Context.java,v 
1.12 2000/10/29 00:35:04 craigmcc Exp $
  + * $Revision: 1.12 $
  + * $Date: 2000/10/29 00:35:04 $
    *
    * ====================================================================
    *
  @@ -95,7 +95,7 @@
    * <p>
    *
    * @author Craig R. McClanahan
  - * @version $Revision: 1.11 $ $Date: 2000/10/21 13:30:32 $
  + * @version $Revision: 1.12 $ $Date: 2000/10/29 00:35:04 $
    */
   
   public interface Context extends Container {
  @@ -409,6 +409,15 @@
   
   
       /**
  +     * Add a resource environment reference for this web application.
  +     *
  +     * @param name The resource environment reference name
  +     * @param type The resource environment reference type
  +     */
  +    public void addResourceEnvRef(String name, String type);
  +
  +
  +    /**
        * Add a security role reference for this web application.
        *
        * @param role Security role used in the application
  @@ -626,6 +635,23 @@
        * @param name Name of the desired resource reference
        */
       public ContextResource findResource(String name);
  +
  +
  +    /**
  +     * Return the resource environment reference type for the specified
  +     * name, if any; otherwise return <code>null</code>.
  +     *
  +     * @param name Name of the desired resource environment reference
  +     */
  +    public String findResourceEnvRef(String name);
  +
  +
  +    /**
  +     * Return the set of resource environment reference names for this
  +     * web application.  If none have been specified, a zero-length
  +     * array is returned.
  +     */
  +    public String[] findResourceEnvRefs();
   
   
       /**
  
  
  
  1.5       +4 -5      
jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/authenticator/AuthenticatorBase.java
  
  Index: AuthenticatorBase.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/authenticator/AuthenticatorBase.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- AuthenticatorBase.java    2000/10/18 18:15:50     1.4
  +++ AuthenticatorBase.java    2000/10/29 00:35:04     1.5
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/authenticator/AuthenticatorBase.java,v
 1.4 2000/10/18 18:15:50 craigmcc Exp $
  - * $Revision: 1.4 $
  - * $Date: 2000/10/18 18:15:50 $
  + * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/authenticator/AuthenticatorBase.java,v
 1.5 2000/10/29 00:35:04 craigmcc Exp $
  + * $Revision: 1.5 $
  + * $Date: 2000/10/29 00:35:04 $
    *
    * ====================================================================
    *
  @@ -116,7 +116,7 @@
    * requests.  Requests of any other type will simply be passed through.
    *
    * @author Craig R. McClanahan
  - * @version $Revision: 1.4 $ $Date: 2000/10/18 18:15:50 $
  + * @version $Revision: 1.5 $ $Date: 2000/10/29 00:35:04 $
    */
   
   
  @@ -617,7 +617,6 @@
       /**
        * Return the SecurityConstraint configured to guard the request URI for
        * this request, or <code>null</code> if there is no such constraint.
  -     * <b>FIXME - Need to do length-first matching.</b>
        *
        * @param request Request we are processing
        */
  
  
  
  1.24      +72 -4     
jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/StandardContext.java
  
  Index: StandardContext.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/StandardContext.java,v
  retrieving revision 1.23
  retrieving revision 1.24
  diff -u -r1.23 -r1.24
  --- StandardContext.java      2000/10/22 09:55:52     1.23
  +++ StandardContext.java      2000/10/29 00:35:04     1.24
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/StandardContext.java,v
 1.23 2000/10/22 09:55:52 craigmcc Exp $
  - * $Revision: 1.23 $
  - * $Date: 2000/10/22 09:55:52 $
  + * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/StandardContext.java,v
 1.24 2000/10/29 00:35:04 craigmcc Exp $
  + * $Revision: 1.24 $
  + * $Date: 2000/10/29 00:35:04 $
    *
    * ====================================================================
    *
  @@ -114,7 +114,7 @@
    * requests directed to a particular servlet.
    *
    * @author Craig R. McClanahan
  - * @version $Revision: 1.23 $ $Date: 2000/10/22 09:55:52 $
  + * @version $Revision: 1.24 $ $Date: 2000/10/29 00:35:04 $
    */
   
   public final class StandardContext
  @@ -315,6 +315,13 @@
   
   
       /**
  +     * The resource environment references for this web application,
  +     * keyed by name.
  +     */
  +    private HashMap resourceEnvRefs = new HashMap();
  +
  +
  +    /**
        * The resource references for this web application, keyed by name.
        */
       private HashMap resources = new HashMap();
  @@ -1118,6 +1125,22 @@
   
   
       /**
  +     * Add a resource environment reference for this web application.
  +     *
  +     * @param name The resource environment reference name
  +     * @param type The resource environment reference type
  +     */
  +    public void addResourceEnvRef(String name, String type) {
  +
  +        synchronized (resourceEnvRefs) {
  +            resourceEnvRefs.put(name, type);
  +        }
  +        fireContainerEvent("addResourceEnvRef", name);
  +
  +    }
  +
  +
  +    /**
        * Add a security role reference for this web application.
        *
        * @param role Security role used in the application
  @@ -1587,6 +1610,36 @@
   
   
       /**
  +     * Return the resource environment reference type for the specified
  +     * name, if any; otherwise return <code>null</code>.
  +     *
  +     * @param name Name of the desired resource environment reference
  +     */
  +    public String findResourceEnvRef(String name) {
  +
  +        synchronized (resourceEnvRefs) {
  +            return ((String) resourceEnvRefs.get(name));
  +        }
  +
  +    }
  +
  +
  +    /**
  +     * Return the set of resource environment reference names for this
  +     * web application.  If none have been specified, a zero-length
  +     * array is returned.
  +     */
  +    public String[] findResourceEnvRefs() {
  +
  +        synchronized (resourceEnvRefs) {
  +            String results[] = new String[resourceEnvRefs.size()];
  +            return ((String[]) resourceEnvRefs.keySet().toArray(results));
  +        }
  +
  +    }
  +
  +
  +    /**
        * Return the defined resource references for this application.  If
        * none have been defined, a zero-length array is returned.
        */
  @@ -2247,6 +2300,21 @@
            resources.remove(name);
        }
        fireContainerEvent("removeResource", name);
  +
  +    }
  +
  +
  +    /**
  +     * Remove any resource environment reference with the specified name.
  +     *
  +     * @param name Name of the resource environment reference to remove
  +     */
  +    public void removeResourceEnvRef(String name) {
  +
  +        synchronized (resourceEnvRefs) {
  +            resourceEnvRefs.remove(name);
  +        }
  +        fireContainerEvent("removeResourceEnvRef", name);
   
       }
   
  
  
  
  1.3       +25 -6     
jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/deploy/ContextResource.java
  
  Index: ContextResource.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/deploy/ContextResource.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ContextResource.java      2000/08/20 03:42:07     1.2
  +++ ContextResource.java      2000/10/29 00:35:05     1.3
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/deploy/ContextResource.java,v
 1.2 2000/08/20 03:42:07 craigmcc Exp $
  - * $Revision: 1.2 $
  - * $Date: 2000/08/20 03:42:07 $
  + * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/deploy/ContextResource.java,v
 1.3 2000/10/29 00:35:05 craigmcc Exp $
  + * $Revision: 1.3 $
  + * $Date: 2000/10/29 00:35:05 $
    *
    * ====================================================================
    *
  @@ -71,7 +71,7 @@
    * deployment descriptor.
    *
    * @author Craig R. McClanahan
  - * @version $Revision: 1.2 $ $Date: 2000/08/20 03:42:07 $
  + * @version $Revision: 1.3 $ $Date: 2000/10/29 00:35:05 $
    */
   
   public final class ContextResource {
  @@ -81,8 +81,8 @@
   
   
       /**
  -     * The authorization requirement for this resource (SERVLET or
  -     * CONTAINER).
  +     * The authorization requirement for this resource
  +     * (<code>Application</code> or <code>Container</code>).
        */
       private String auth = null;
   
  @@ -124,6 +124,21 @@
   
   
       /**
  +     * The sharing scope of this resource factory (<code>Shareable</code>
  +     * or <code>Unshareable</code>).
  +     */
  +    private String scope = "Shareable";
  +
  +    public String getScope() {
  +        return (this.scope);
  +    }
  +
  +    public void setScope(String scope) {
  +        this.scope = scope;
  +    }
  +
  +
  +    /**
        * The type of this resource.
        */
       private String type = null;
  @@ -160,6 +175,10 @@
            sb.append(", auth=");
            sb.append(auth);
        }
  +        if (scope != null) {
  +            sb.append(", scope=");
  +            sb.append(scope);
  +        }
        sb.append("]");
        return (sb.toString());
   
  
  
  
  1.3       +50 -4     
jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/deploy/SecurityConstraint.java
  
  Index: SecurityConstraint.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/deploy/SecurityConstraint.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- SecurityConstraint.java   2000/10/09 23:30:40     1.2
  +++ SecurityConstraint.java   2000/10/29 00:35:05     1.3
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/deploy/SecurityConstraint.java,v
 1.2 2000/10/09 23:30:40 craigmcc Exp $
  - * $Revision: 1.2 $
  - * $Date: 2000/10/09 23:30:40 $
  + * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/deploy/SecurityConstraint.java,v
 1.3 2000/10/29 00:35:05 craigmcc Exp $
  + * $Revision: 1.3 $
  + * $Date: 2000/10/29 00:35:05 $
    *
    * ====================================================================
    *
  @@ -77,7 +77,7 @@
    * this class is synchronized.
    *
    * @author Craig R. McClanahan
  - * @version $Revision: 1.2 $ $Date: 2000/10/09 23:30:40 $
  + * @version $Revision: 1.3 $ $Date: 2000/10/29 00:35:05 $
    */
   
   public final class SecurityConstraint {
  @@ -100,6 +100,13 @@
   
   
       /**
  +     * Was the "all roles" wildcard included in the authorization constraints
  +     * for this security constraint?
  +     */
  +    private boolean allRoles = false;
  +
  +
  +    /**
        * Was an authorization constraint included in this security constraint?
        * This is necessary to distinguish the case where an auth-constraint with
        * no roles (signifying no direct access at all) was requested, versus
  @@ -123,6 +130,12 @@
   
   
       /**
  +     * The display name of this security constraint.
  +     */
  +    private String displayName = null;
  +
  +
  +    /**
        * The user data constraint for this security constraint.  Must be NONE,
        * INTEGRAL, or CONFIDENTIAL.
        */
  @@ -133,6 +146,17 @@
   
   
       /**
  +     * Was the "all roles" wildcard included in this authentication
  +     * constraint?
  +     */
  +    public boolean getAllRoles() {
  +
  +        return (this.allRoles);
  +
  +    }
  +
  +
  +    /**
        * Return the authorization constraint present flag for this security
        * constraint.
        */
  @@ -155,6 +179,26 @@
   
   
       /**
  +     * Return the display name of this security constraint.
  +     */
  +    public String getDisplayName() {
  +
  +        return (this.displayName);
  +
  +    }
  +
  +
  +    /**
  +     * Set the display name of this security constraint.
  +     */
  +    public void setDisplayName(String displayName) {
  +
  +        this.displayName = displayName;
  +
  +    }
  +
  +
  +    /**
        * Return the user data constraint for this security constraint.
        */
       public String getUserConstraint() {
  @@ -196,6 +240,8 @@
        results[authRoles.length] = authRole;
        authRoles = results;
           authConstraint = true;
  +        if ("*".equals(authRole))
  +            allRoles = true;
   
       }
   
  
  
  
  1.28      +16 -5     
jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/startup/ContextConfig.java
  
  Index: ContextConfig.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/startup/ContextConfig.java,v
  retrieving revision 1.27
  retrieving revision 1.28
  diff -u -r1.27 -r1.28
  --- ContextConfig.java        2000/10/21 13:35:00     1.27
  +++ ContextConfig.java        2000/10/29 00:35:06     1.28
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/startup/ContextConfig.java,v
 1.27 2000/10/21 13:35:00 craigmcc Exp $
  - * $Revision: 1.27 $
  - * $Date: 2000/10/21 13:35:00 $
  + * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/startup/ContextConfig.java,v
 1.28 2000/10/29 00:35:06 craigmcc Exp $
  + * $Revision: 1.28 $
  + * $Date: 2000/10/29 00:35:06 $
    *
    * ====================================================================
    *
  @@ -117,7 +117,7 @@
    * of that Context, and the associated defined servlets.
    *
    * @author Craig R. McClanahan
  - * @version $Revision: 1.27 $ $Date: 2000/10/21 13:35:00 $
  + * @version $Revision: 1.28 $ $Date: 2000/10/29 00:35:06 $
    */
   
   public final class ContextConfig
  @@ -462,7 +462,7 @@
                       mapper.methodSetter("setRemote", 0));
        mapper.addRule("web-app/ejb-ref/ejb-link",
                       mapper.methodSetter("setLink", 0));
  -     mapper.addRule("web-app/ejb-ref/runAs",
  +     mapper.addRule("web-app/ejb-ref/run-as",
                       mapper.methodSetter("setRunAs", 0));
   
        mapper.addRule("web-app/env-entry",
  @@ -552,6 +552,13 @@
                       mapper.methodParam(1));
   
   
  +        mapper.addRule("web-app/resource-env-ref",
  +                       mapper.methodSetter("addResourceEnvRef", 2));
  +        mapper.addRule("web-app/resource-env-ref/resource-env-ref-name",
  +                       mapper.methodParam(0));
  +        mapper.addRule("web-app/resource-env-ref/resource-env-ref-type",
  +                       mapper.methodParam(1));
  +
        mapper.addRule("web-app/resource-ref",
               mapper.objectCreate("org.apache.catalina.deploy.ContextResource"));
           mapper.addRule("web-app/resource-ref",
  @@ -563,6 +570,8 @@
                       mapper.methodSetter("setAuth", 0));
        mapper.addRule("web-app/resource-ref/res-ref-name",
                       mapper.methodSetter("setName", 0));
  +        mapper.addRule("web-app/resource-ref/res-sharing-scope",
  +                       mapper.methodSetter("setScope", 0));
        mapper.addRule("web-app/resource-ref/res-type",
                       mapper.methodSetter("setType", 0));
   
  @@ -575,6 +584,8 @@
                          new SetAuthConstraint());
        mapper.addRule("web-app/security-constraint/auth-constraint/role-name",
                       mapper.methodSetter("addAuthRole", 0));
  +        mapper.addRule("web-app/security-constraint/display-name",
  +                       mapper.methodSetter("setDisplayName", 0));
        
mapper.addRule("web-app/security-constraint/user-data-constraint/transport-guarantee",
                       mapper.methodSetter("setUserConstraint", 0));
        mapper.addRule("web-app/security-constraint/web-resource-collection",
  
  
  
  1.7       +1 -0      jakarta-tomcat-4.0/webapps/examples/WEB-INF/web.xml
  
  Index: web.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-4.0/webapps/examples/WEB-INF/web.xml,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- web.xml   2000/10/28 01:38:50     1.6
  +++ web.xml   2000/10/29 00:35:06     1.7
  @@ -110,6 +110,7 @@
       </taglib>
   
       <security-constraint>
  +      <display-name>Example Security Constraint</display-name>
         <web-resource-collection>
            <web-resource-name>Protected Area</web-resource-name>
         <!-- Define the context-relative URL(s) to be protected -->
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to