View | Details | Raw Unified | Return to bug 55166
Collapse All | Expand All

(-)java/javax/servlet/jsp/resources/jsp_2_0.xsd (-288 lines)
Lines 1-288 Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
<!--
3
 Licensed to the Apache Software Foundation (ASF) under one or more
4
  contributor license agreements.  See the NOTICE file distributed with
5
  this work for additional information regarding copyright ownership.
6
  The ASF licenses this file to You under the Apache License, Version 2.0
7
  (the "License"); you may not use this file except in compliance with
8
  the License.  You may obtain a copy of the License at
9
10
      http://www.apache.org/licenses/LICENSE-2.0
11
12
  Unless required by applicable law or agreed to in writing, software
13
  distributed under the License is distributed on an "AS IS" BASIS,
14
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
  See the License for the specific language governing permissions and
16
  limitations under the License.
17
-->
18
<xsd:schema xmlns="http://www.w3.org/2001/XMLSchema"
19
            targetNamespace="http://java.sun.com/xml/ns/j2ee"
20
            xmlns:j2ee="http://java.sun.com/xml/ns/j2ee"
21
            xmlns:xsd="http://www.w3.org/2001/XMLSchema"
22
            elementFormDefault="qualified"
23
            attributeFormDefault="unqualified"
24
            version="2.0">
25
  <xsd:annotation>
26
    <xsd:documentation>
27
      @(#)jsp_2_0.xsds  1.17 03/18/03
28
    </xsd:documentation>
29
  </xsd:annotation>
30
31
  <xsd:annotation>
32
    <xsd:documentation>
33
34
      This is the XML Schema for the JSP 2.0 deployment descriptor
35
      types.  The JSP 2.0 schema contains all the special
36
      structures and datatypes that are necessary to use JSP files
37
      from a web application.
38
39
      The contents of this schema is used by the web-app_2_4.xsd
40
      file to define JSP specific content.
41
42
    </xsd:documentation>
43
  </xsd:annotation>
44
45
  <xsd:annotation>
46
    <xsd:documentation>
47
48
      The following conventions apply to all J2EE
49
      deployment descriptor elements unless indicated otherwise.
50
51
      - In elements that specify a pathname to a file within the
52
        same JAR file, relative filenames (i.e., those not
53
        starting with "/") are considered relative to the root of
54
        the JAR file's namespace.  Absolute filenames (i.e., those
55
        starting with "/") also specify names in the root of the
56
        JAR file's namespace.  In general, relative names are
57
        preferred.  The exception is .war files where absolute
58
        names are preferred for consistency with the Servlet API.
59
60
    </xsd:documentation>
61
  </xsd:annotation>
62
63
  <xsd:include schemaLocation="j2ee_1_4.xsd"/>
64
65
66
<!-- **************************************************** -->
67
68
  <xsd:complexType name="jsp-configType">
69
    <xsd:annotation>
70
      <xsd:documentation>
71
72
        The jsp-configType is used to provide global configuration
73
        information for the JSP files in a web application. It has
74
        two subelements, taglib and jsp-property-group.
75
76
      </xsd:documentation>
77
    </xsd:annotation>
78
79
    <xsd:sequence>
80
      <xsd:element name="taglib"
81
                   type="j2ee:taglibType"
82
                   minOccurs="0"
83
                   maxOccurs="unbounded"/>
84
      <xsd:element name="jsp-property-group"
85
                   type="j2ee:jsp-property-groupType"
86
                   minOccurs="0"
87
                   maxOccurs="unbounded"/>
88
    </xsd:sequence>
89
    <xsd:attribute name="id" type="xsd:ID"/>
90
  </xsd:complexType>
91
92
<!-- **************************************************** -->
93
94
  <xsd:complexType name="jsp-fileType">
95
    <xsd:annotation>
96
      <xsd:documentation>
97
98
        The jsp-file element contains the full path to a JSP file
99
        within the web application beginning with a `/'.
100
101
      </xsd:documentation>
102
    </xsd:annotation>
103
104
    <xsd:simpleContent>
105
      <xsd:restriction base="j2ee:pathType"/>
106
    </xsd:simpleContent>
107
  </xsd:complexType>
108
109
<!-- **************************************************** -->
110
111
  <xsd:complexType name="jsp-property-groupType">
112
    <xsd:annotation>
113
      <xsd:documentation>
114
115
        The jsp-property-groupType is used to group a number of
116
        files so they can be given global property information.
117
        All files so described are deemed to be JSP files.  The
118
        following additional properties can be described:
119
120
            - Control whether EL is ignored
121
            - Control whether scripting elements are invalid
122
            - Indicate pageEncoding information.
123
            - Indicate that a resource is a JSP document (XML)
124
            - Prelude and Coda automatic includes.
125
126
      </xsd:documentation>
127
    </xsd:annotation>
128
129
    <xsd:sequence>
130
      <xsd:group ref="j2ee:descriptionGroup"/>
131
      <xsd:element name="url-pattern"
132
                   type="j2ee:url-patternType"
133
                   maxOccurs="unbounded"/>
134
      <xsd:element name="el-ignored"
135
                   type="j2ee:true-falseType"
136
                   minOccurs="0">
137
        <xsd:annotation>
138
          <xsd:documentation>
139
140
            Can be used to easily set the isELIgnored
141
            property of a group of JSP pages.  By default, the
142
            EL evaluation is enabled for Web Applications using
143
            a Servlet 2.4 or greater web.xml, and disabled
144
            otherwise.
145
146
          </xsd:documentation>
147
        </xsd:annotation>
148
      </xsd:element>
149
      <xsd:element name="page-encoding"
150
                   type="j2ee:string"
151
                   minOccurs="0">
152
        <xsd:annotation>
153
          <xsd:documentation>
154
155
            The valid values of page-encoding are those of the
156
            pageEncoding page directive.  It is a
157
            translation-time error to name different encodings
158
            in the pageEncoding attribute of the page directive
159
            of a JSP page and in a JSP configuration element
160
            matching the page.  It is also a translation-time
161
            error to name different encodings in the prolog
162
            or text declaration of a document in XML syntax and
163
            in a JSP configuration element matching the document.
164
            It is legal to name the same encoding through
165
            mulitple mechanisms.
166
167
          </xsd:documentation>
168
        </xsd:annotation>
169
      </xsd:element>
170
      <xsd:element name="scripting-invalid"
171
                   type="j2ee:true-falseType"
172
                   minOccurs="0">
173
        <xsd:annotation>
174
          <xsd:documentation>
175
176
            Can be used to easily disable scripting in a
177
            group of JSP pages.  By default, scripting is
178
            enabled.
179
180
          </xsd:documentation>
181
        </xsd:annotation>
182
      </xsd:element>
183
      <xsd:element name="is-xml"
184
                   type="j2ee:true-falseType"
185
                   minOccurs="0">
186
        <xsd:annotation>
187
          <xsd:documentation>
188
189
            If true, denotes that the group of resources
190
            that match the URL pattern are JSP documents,
191
            and thus must be interpreted as XML documents.
192
            If false, the resources are assumed to not
193
            be JSP documents, unless there is another
194
            property group that indicates otherwise.
195
196
          </xsd:documentation>
197
        </xsd:annotation>
198
      </xsd:element>
199
      <xsd:element name="include-prelude"
200
                   type="j2ee:pathType"
201
                   minOccurs="0"
202
                   maxOccurs="unbounded">
203
        <xsd:annotation>
204
          <xsd:documentation>
205
206
            The include-prelude element is a context-relative
207
            path that must correspond to an element in the
208
            Web Application.  When the element is present,
209
            the given path will be automatically included (as
210
            in an include directive) at the beginning of each
211
            JSP page in this jsp-property-group.
212
213
          </xsd:documentation>
214
        </xsd:annotation>
215
      </xsd:element>
216
      <xsd:element name="include-coda"
217
                   type="j2ee:pathType"
218
                   minOccurs="0"
219
                   maxOccurs="unbounded">
220
        <xsd:annotation>
221
          <xsd:documentation>
222
223
            The include-coda element is a context-relative
224
            path that must correspond to an element in the
225
            Web Application.  When the element is present,
226
            the given path will be automatically included (as
227
            in an include directive) at the end of each
228
            JSP page in this jsp-property-group.
229
230
          </xsd:documentation>
231
        </xsd:annotation>
232
      </xsd:element>
233
    </xsd:sequence>
234
    <xsd:attribute name="id" type="xsd:ID"/>
235
  </xsd:complexType>
236
237
<!-- **************************************************** -->
238
239
  <xsd:complexType name="taglibType">
240
    <xsd:annotation>
241
      <xsd:documentation>
242
243
        The taglibType defines the syntax for declaring in
244
        the deployment descriptor that a tag library is
245
        available to the application.  This can be done
246
        to override implicit map entries from TLD files and
247
        from the container.
248
249
      </xsd:documentation>
250
    </xsd:annotation>
251
252
    <xsd:sequence>
253
      <xsd:element name="taglib-uri"
254
                   type="j2ee:string">
255
        <xsd:annotation>
256
          <xsd:documentation>
257
258
            A taglib-uri element describes a URI identifying a
259
            tag library used in the web application.  The body
260
            of the taglib-uri element may be either an
261
            absolute URI specification, or a relative URI.
262
            There should be no entries in web.xml with the
263
            same taglib-uri value.
264
265
          </xsd:documentation>
266
        </xsd:annotation>
267
      </xsd:element>
268
269
      <xsd:element name="taglib-location"
270
                   type="j2ee:pathType">
271
        <xsd:annotation>
272
          <xsd:documentation>
273
274
            the taglib-location element contains the location
275
            (as a resource relative to the root of the web
276
            application) where to find the Tag Library
277
            Description file for the tag library.
278
279
          </xsd:documentation>
280
        </xsd:annotation>
281
      </xsd:element>
282
283
    </xsd:sequence>
284
    <xsd:attribute name="id" type="xsd:ID"/>
285
  </xsd:complexType>
286
287
</xsd:schema>
288
(-)java/javax/servlet/jsp/resources/jsp_2_1.xsd (-73 lines)
Lines 1-73 Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
3
<!--
4
  Licensed to the Apache Software Foundation (ASF) under one or more
5
  contributor license agreements.  See the NOTICE file distributed with
6
  this work for additional information regarding copyright ownership.
7
  The ASF licenses this file to You under the Apache License, Version 2.0
8
  (the "License"); you may not use this file except in compliance with
9
  the License.  You may obtain a copy of the License at
10
11
      http://www.apache.org/licenses/LICENSE-2.0
12
13
  Unless required by applicable law or agreed to in writing, software
14
  distributed under the License is distributed on an "AS IS" BASIS,
15
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
  See the License for the specific language governing permissions and
17
  limitations under the License.
18
-->
19
20
<!--
21
  **  The actual Sun XSD for this stripped down XSD can be found at
22
  **  http://java.sun.com/xml/ns/javaee/jsp_2_1.xsd
23
  **  This XSD contains only the functional elements for programatic use.
24
-->
25
26
<xsd:schema xmlns="http://www.w3.org/2001/XMLSchema"
27
            targetNamespace="http://java.sun.com/xml/ns/javaee"
28
            xmlns:javaee="http://java.sun.com/xml/ns/javaee"
29
            xmlns:xsd="http://www.w3.org/2001/XMLSchema"
30
            elementFormDefault="qualified"
31
            attributeFormDefault="unqualified"
32
            version="2.1">
33
34
    <xsd:include schemaLocation="javaee_5.xsd" />
35
36
    <xsd:complexType name="jsp-configType">
37
        <xsd:sequence>
38
            <xsd:element name="taglib" type="javaee:taglibType" minOccurs="0" maxOccurs="unbounded" />
39
            <xsd:element name="jsp-property-group" type="javaee:jsp-property-groupType" minOccurs="0" maxOccurs="unbounded" />
40
        </xsd:sequence>
41
        <xsd:attribute name="id" type="xsd:ID" />
42
    </xsd:complexType>
43
44
    <xsd:complexType name="jsp-fileType">
45
        <xsd:simpleContent>
46
            <xsd:restriction base="javaee:pathType" />
47
        </xsd:simpleContent>
48
    </xsd:complexType>
49
50
    <xsd:complexType name="jsp-property-groupType">
51
        <xsd:sequence>
52
            <xsd:group ref="javaee:descriptionGroup"/>
53
            <xsd:element name="url-pattern" type="javaee:url-patternType" maxOccurs="unbounded" />
54
            <xsd:element name="el-ignored" type="javaee:true-falseType" minOccurs="0" />
55
            <xsd:element name="page-encoding" type="javaee:string" minOccurs="0" />
56
            <xsd:element name="scripting-invalid" type="javaee:true-falseType" minOccurs="0" />
57
            <xsd:element name="is-xml" type="javaee:true-falseType" minOccurs="0" />
58
            <xsd:element name="include-prelude" type="javaee:pathType" minOccurs="0" maxOccurs="unbounded" />
59
            <xsd:element name="include-coda" type="javaee:pathType" minOccurs="0" maxOccurs="unbounded" />
60
            <xsd:element name="deferred-syntax-allowed-as-literal" type="javaee:true-falseType" minOccurs="0" />
61
            <xsd:element name="trim-directive-whitespaces" type="javaee:true-falseType" minOccurs="0" />
62
        </xsd:sequence>
63
        <xsd:attribute name="id" type="xsd:ID" />
64
    </xsd:complexType>
65
66
    <xsd:complexType name="taglibType">
67
        <xsd:sequence>
68
            <xsd:element name="taglib-uri" type="javaee:string" />
69
            <xsd:element name="taglib-location" type="javaee:pathType" />
70
        </xsd:sequence>
71
        <xsd:attribute name="id" type="xsd:ID" />
72
    </xsd:complexType>
73
</xsd:schema>
(-)java/javax/servlet/jsp/resources/jsp_2_2.xsd (-406 lines)
Lines 1-406 Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
<xsd:schema xmlns="http://www.w3.org/2001/XMLSchema"
3
            targetNamespace="http://java.sun.com/xml/ns/javaee"
4
            xmlns:javaee="http://java.sun.com/xml/ns/javaee"
5
            xmlns:xsd="http://www.w3.org/2001/XMLSchema"
6
            elementFormDefault="qualified"
7
            attributeFormDefault="unqualified"
8
            version="2.2">
9
  <xsd:annotation>
10
    <xsd:documentation>
11
12
      $Id$
13
14
    </xsd:documentation>
15
  </xsd:annotation>
16
17
  <xsd:annotation>
18
    <xsd:documentation>
19
20
      DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
21
22
      Copyright 2003-2009 Sun Microsystems, Inc. All rights reserved.
23
24
      The contents of this file are subject to the terms of either the
25
      GNU General Public License Version 2 only ("GPL") or the Common
26
      Development and Distribution License("CDDL") (collectively, the
27
      "License").  You may not use this file except in compliance with
28
      the License. You can obtain a copy of the License at
29
      https://glassfish.dev.java.net/public/CDDL+GPL.html or
30
      glassfish/bootstrap/legal/LICENSE.txt.  See the License for the
31
      specific language governing permissions and limitations under the
32
      License.
33
34
      When distributing the software, include this License Header
35
      Notice in each file and include the License file at
36
      glassfish/bootstrap/legal/LICENSE.txt.  Sun designates this
37
      particular file as subject to the "Classpath" exception as
38
      provided by Sun in the GPL Version 2 section of the License file
39
      that accompanied this code.  If applicable, add the following
40
      below the License Header, with the fields enclosed by brackets []
41
      replaced by your own identifying information:
42
      "Portions Copyrighted [year] [name of copyright owner]"
43
44
      Contributor(s):
45
46
      If you wish your version of this file to be governed by only the
47
      CDDL or only the GPL Version 2, indicate your decision by adding
48
      "[Contributor] elects to include this software in this
49
      distribution under the [CDDL or GPL Version 2] license."  If you
50
      don't indicate a single choice of license, a recipient has the
51
      option to distribute your version of this file under either the
52
      CDDL, the GPL Version 2 or to extend the choice of license to its
53
      licensees as provided above.  However, if you add GPL Version 2
54
      code and therefore, elected the GPL Version 2 license, then the
55
      option applies only if the new code is made subject to such
56
      option by the copyright holder.
57
58
    </xsd:documentation>
59
  </xsd:annotation>
60
61
  <xsd:annotation>
62
    <xsd:documentation>
63
      The Apache Software Foundation elects to include this software under the
64
      CDDL license.
65
    </xsd:documentation>
66
  </xsd:annotation>
67
68
  <xsd:annotation>
69
    <xsd:documentation>
70
71
      This is the XML Schema for the JSP 2.2 deployment descriptor
72
      types.  The JSP 2.2 schema contains all the special
73
      structures and datatypes that are necessary to use JSP files
74
      from a web application.
75
76
      The contents of this schema is used by the web-common_3_0.xsd
77
      file to define JSP specific content.
78
79
    </xsd:documentation>
80
  </xsd:annotation>
81
82
  <xsd:annotation>
83
    <xsd:documentation>
84
85
      The following conventions apply to all Java EE
86
      deployment descriptor elements unless indicated otherwise.
87
88
      - In elements that specify a pathname to a file within the
89
      same JAR file, relative filenames (i.e., those not
90
      starting with "/") are considered relative to the root of
91
      the JAR file's namespace.  Absolute filenames (i.e., those
92
      starting with "/") also specify names in the root of the
93
      JAR file's namespace.  In general, relative names are
94
      preferred.  The exception is .war files where absolute
95
      names are preferred for consistency with the Servlet API.
96
97
    </xsd:documentation>
98
  </xsd:annotation>
99
100
  <xsd:include schemaLocation="javaee_6.xsd"/>
101
102
103
<!-- **************************************************** -->
104
105
  <xsd:complexType name="jsp-configType">
106
    <xsd:annotation>
107
      <xsd:documentation>
108
109
        The jsp-configType is used to provide global configuration
110
        information for the JSP files in a web application. It has
111
        two subelements, taglib and jsp-property-group.
112
113
      </xsd:documentation>
114
    </xsd:annotation>
115
    <xsd:sequence>
116
      <xsd:element name="taglib"
117
                   type="javaee:taglibType"
118
                   minOccurs="0"
119
                   maxOccurs="unbounded"/>
120
      <xsd:element name="jsp-property-group"
121
                   type="javaee:jsp-property-groupType"
122
                   minOccurs="0"
123
                   maxOccurs="unbounded"/>
124
    </xsd:sequence>
125
    <xsd:attribute name="id"
126
                   type="xsd:ID"/>
127
  </xsd:complexType>
128
129
130
<!-- **************************************************** -->
131
132
  <xsd:complexType name="jsp-fileType">
133
    <xsd:annotation>
134
      <xsd:documentation>
135
136
        The jsp-file element contains the full path to a JSP file
137
        within the web application beginning with a `/'.
138
139
      </xsd:documentation>
140
    </xsd:annotation>
141
    <xsd:simpleContent>
142
      <xsd:restriction base="javaee:pathType"/>
143
    </xsd:simpleContent>
144
  </xsd:complexType>
145
146
147
<!-- **************************************************** -->
148
149
  <xsd:complexType name="jsp-property-groupType">
150
    <xsd:annotation>
151
      <xsd:documentation>
152
153
        The jsp-property-groupType is used to group a number of
154
        files so they can be given global property information.
155
        All files so described are deemed to be JSP files.  The
156
        following additional properties can be described:
157
158
        - Control whether EL is ignored.
159
        - Control whether scripting elements are invalid.
160
        - Indicate pageEncoding information.
161
        - Indicate that a resource is a JSP document (XML).
162
        - Prelude and Coda automatic includes.
163
        - Control whether the character sequence #{ is allowed
164
        when used as a String literal.
165
        - Control whether template text containing only
166
        whitespaces must be removed from the response output.
167
        - Indicate the default contentType information.
168
        - Indicate the default buffering model for JspWriter
169
        - Control whether error should be raised for the use of
170
        undeclared namespaces in a JSP page.
171
172
      </xsd:documentation>
173
    </xsd:annotation>
174
    <xsd:sequence>
175
      <xsd:group ref="javaee:descriptionGroup"/>
176
      <xsd:element name="url-pattern"
177
                   type="javaee:url-patternType"
178
                   maxOccurs="unbounded"/>
179
      <xsd:element name="el-ignored"
180
                   type="javaee:true-falseType"
181
                   minOccurs="0">
182
        <xsd:annotation>
183
          <xsd:documentation>
184
185
            Can be used to easily set the isELIgnored
186
            property of a group of JSP pages.  By default, the
187
            EL evaluation is enabled for Web Applications using
188
            a Servlet 2.4 or greater web.xml, and disabled
189
            otherwise.
190
191
          </xsd:documentation>
192
        </xsd:annotation>
193
      </xsd:element>
194
      <xsd:element name="page-encoding"
195
                   type="javaee:string"
196
                   minOccurs="0">
197
        <xsd:annotation>
198
          <xsd:documentation>
199
200
            The valid values of page-encoding are those of the
201
            pageEncoding page directive.  It is a
202
            translation-time error to name different encodings
203
            in the pageEncoding attribute of the page directive
204
            of a JSP page and in a JSP configuration element
205
            matching the page.  It is also a translation-time
206
            error to name different encodings in the prolog
207
            or text declaration of a document in XML syntax and
208
            in a JSP configuration element matching the document.
209
            It is legal to name the same encoding through
210
            mulitple mechanisms.
211
212
          </xsd:documentation>
213
        </xsd:annotation>
214
      </xsd:element>
215
      <xsd:element name="scripting-invalid"
216
                   type="javaee:true-falseType"
217
                   minOccurs="0">
218
        <xsd:annotation>
219
          <xsd:documentation>
220
221
            Can be used to easily disable scripting in a
222
            group of JSP pages.  By default, scripting is
223
            enabled.
224
225
          </xsd:documentation>
226
        </xsd:annotation>
227
      </xsd:element>
228
      <xsd:element name="is-xml"
229
                   type="javaee:true-falseType"
230
                   minOccurs="0">
231
        <xsd:annotation>
232
          <xsd:documentation>
233
234
            If true, denotes that the group of resources
235
            that match the URL pattern are JSP documents,
236
            and thus must be interpreted as XML documents.
237
            If false, the resources are assumed to not
238
            be JSP documents, unless there is another
239
            property group that indicates otherwise.
240
241
          </xsd:documentation>
242
        </xsd:annotation>
243
      </xsd:element>
244
      <xsd:element name="include-prelude"
245
                   type="javaee:pathType"
246
                   minOccurs="0"
247
                   maxOccurs="unbounded">
248
        <xsd:annotation>
249
          <xsd:documentation>
250
251
            The include-prelude element is a context-relative
252
            path that must correspond to an element in the
253
            Web Application.  When the element is present,
254
            the given path will be automatically included (as
255
            in an include directive) at the beginning of each
256
            JSP page in this jsp-property-group.
257
258
          </xsd:documentation>
259
        </xsd:annotation>
260
      </xsd:element>
261
      <xsd:element name="include-coda"
262
                   type="javaee:pathType"
263
                   minOccurs="0"
264
                   maxOccurs="unbounded">
265
        <xsd:annotation>
266
          <xsd:documentation>
267
268
            The include-coda element is a context-relative
269
            path that must correspond to an element in the
270
            Web Application.  When the element is present,
271
            the given path will be automatically included (as
272
            in an include directive) at the end of each
273
            JSP page in this jsp-property-group.
274
275
          </xsd:documentation>
276
        </xsd:annotation>
277
      </xsd:element>
278
      <xsd:element name="deferred-syntax-allowed-as-literal"
279
                   type="javaee:true-falseType"
280
                   minOccurs="0">
281
        <xsd:annotation>
282
          <xsd:documentation>
283
284
            The character sequence #{ is reserved for EL expressions.
285
            Consequently, a translation error occurs if the #{
286
            character sequence is used as a String literal, unless
287
            this element is enabled (true). Disabled (false) by
288
            default.
289
290
          </xsd:documentation>
291
        </xsd:annotation>
292
      </xsd:element>
293
      <xsd:element name="trim-directive-whitespaces"
294
                   type="javaee:true-falseType"
295
                   minOccurs="0">
296
        <xsd:annotation>
297
          <xsd:documentation>
298
299
            Indicates that template text containing only whitespaces
300
            must be removed from the response output. It has no
301
            effect on JSP documents (XML syntax). Disabled (false)
302
            by default.
303
304
          </xsd:documentation>
305
        </xsd:annotation>
306
      </xsd:element>
307
      <xsd:element name="default-content-type"
308
                   type="javaee:string"
309
                   minOccurs="0">
310
        <xsd:annotation>
311
          <xsd:documentation>
312
313
            The valid values of default-content-type are those of the
314
            contentType page directive.  It specifies the default
315
            response contentType if the page directive does not include
316
            a contentType attribute.
317
318
          </xsd:documentation>
319
        </xsd:annotation>
320
      </xsd:element>
321
      <xsd:element name="buffer"
322
                   type="javaee:string"
323
                   minOccurs="0">
324
        <xsd:annotation>
325
          <xsd:documentation>
326
327
            The valid values of buffer are those of the
328
            buffer page directive.  It specifies if buffering should be
329
            used for the output to response, and if so, the size of the
330
            buffer to use.
331
332
          </xsd:documentation>
333
        </xsd:annotation>
334
      </xsd:element>
335
      <xsd:element name="error-on-undeclared-namespace"
336
                   type="javaee:true-falseType"
337
                   minOccurs="0">
338
        <xsd:annotation>
339
          <xsd:documentation>
340
341
            The default behavior when a tag with unknown namespace is used
342
            in a JSP page (regular syntax) is to silently ignore it.  If
343
            set to true, then an error must be raised during the translation
344
            time when an undeclared tag is used in a JSP page.  Disabled
345
            (false) by default.
346
347
          </xsd:documentation>
348
        </xsd:annotation>
349
      </xsd:element>
350
    </xsd:sequence>
351
    <xsd:attribute name="id"
352
                   type="xsd:ID"/>
353
  </xsd:complexType>
354
355
356
<!-- **************************************************** -->
357
358
  <xsd:complexType name="taglibType">
359
    <xsd:annotation>
360
      <xsd:documentation>
361
362
        The taglibType defines the syntax for declaring in
363
        the deployment descriptor that a tag library is
364
        available to the application.  This can be done
365
        to override implicit map entries from TLD files and
366
        from the container.
367
368
      </xsd:documentation>
369
    </xsd:annotation>
370
    <xsd:sequence>
371
      <xsd:element name="taglib-uri"
372
                   type="javaee:string">
373
        <xsd:annotation>
374
          <xsd:documentation>
375
376
            A taglib-uri element describes a URI identifying a
377
            tag library used in the web application.  The body
378
            of the taglib-uri element may be either an
379
            absolute URI specification, or a relative URI.
380
            There should be no entries in web.xml with the
381
            same taglib-uri value.
382
383
          </xsd:documentation>
384
        </xsd:annotation>
385
      </xsd:element>
386
      <xsd:element name="taglib-location"
387
                   type="javaee:pathType">
388
        <xsd:annotation>
389
          <xsd:documentation>
390
391
            the taglib-location element contains the location
392
            (as a resource relative to the root of the web
393
            application) where to find the Tag Library
394
            Description file for the tag library.
395
396
          </xsd:documentation>
397
        </xsd:annotation>
398
      </xsd:element>
399
    </xsd:sequence>
400
    <xsd:attribute name="id"
401
                   type="xsd:ID"/>
402
  </xsd:complexType>
403
404
</xsd:schema>
405
406
(-)java/javax/servlet/jsp/resources/jsp_2_3.xsd (-396 lines)
Lines 1-396 Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
<xsd:schema xmlns="http://www.w3.org/2001/XMLSchema"
3
            targetNamespace="http://xmlns.jcp.org/xml/ns/javaee"
4
            xmlns:javaee="http://xmlns.jcp.org/xml/ns/javaee"
5
            xmlns:xsd="http://www.w3.org/2001/XMLSchema"
6
            elementFormDefault="qualified"
7
            attributeFormDefault="unqualified"
8
            version="2.3">
9
  <xsd:annotation>
10
    <xsd:documentation>
11
12
      DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
13
14
      Copyright (c) 2009-2013 Oracle and/or its affiliates. All rights reserved.
15
16
      The contents of this file are subject to the terms of either the GNU
17
      General Public License Version 2 only ("GPL") or the Common Development
18
      and Distribution License("CDDL") (collectively, the "License").  You
19
      may not use this file except in compliance with the License.  You can
20
      obtain a copy of the License at
21
      https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html
22
      or packager/legal/LICENSE.txt.  See the License for the specific
23
      language governing permissions and limitations under the License.
24
25
      When distributing the software, include this License Header Notice in each
26
      file and include the License file at packager/legal/LICENSE.txt.
27
28
      GPL Classpath Exception:
29
      Oracle designates this particular file as subject to the "Classpath"
30
      exception as provided by Oracle in the GPL Version 2 section of the License
31
      file that accompanied this code.
32
33
      Modifications:
34
      If applicable, add the following below the License Header, with the fields
35
      enclosed by brackets [] replaced by your own identifying information:
36
      "Portions Copyright [year] [name of copyright owner]"
37
38
      Contributor(s):
39
      If you wish your version of this file to be governed by only the CDDL or
40
      only the GPL Version 2, indicate your decision by adding "[Contributor]
41
      elects to include this software in this distribution under the [CDDL or GPL
42
      Version 2] license."  If you don't indicate a single choice of license, a
43
      recipient has the option to distribute your version of this file under
44
      either the CDDL, the GPL Version 2 or to extend the choice of license to
45
      its licensees as provided above.  However, if you add GPL Version 2 code
46
      and therefore, elected the GPL Version 2 license, then the option applies
47
      only if the new code is made subject to such option by the copyright
48
      holder.
49
50
    </xsd:documentation>
51
  </xsd:annotation>
52
53
  <xsd:annotation>
54
    <xsd:documentation>
55
      The Apache Software Foundation elects to include this software under the
56
      CDDL license.
57
    </xsd:documentation>
58
  </xsd:annotation>
59
60
  <xsd:annotation>
61
    <xsd:documentation>
62
63
      This is the XML Schema for the JSP 2.3 deployment descriptor
64
      types.  The JSP 2.3 schema contains all the special
65
      structures and datatypes that are necessary to use JSP files
66
      from a web application.
67
68
      The contents of this schema is used by the web-common_3_1.xsd
69
      file to define JSP specific content.
70
71
    </xsd:documentation>
72
  </xsd:annotation>
73
74
  <xsd:annotation>
75
    <xsd:documentation>
76
77
      The following conventions apply to all Java EE
78
      deployment descriptor elements unless indicated otherwise.
79
80
      - In elements that specify a pathname to a file within the
81
      same JAR file, relative filenames (i.e., those not
82
      starting with "/") are considered relative to the root of
83
      the JAR file's namespace.  Absolute filenames (i.e., those
84
      starting with "/") also specify names in the root of the
85
      JAR file's namespace.  In general, relative names are
86
      preferred.  The exception is .war files where absolute
87
      names are preferred for consistency with the Servlet API.
88
89
    </xsd:documentation>
90
  </xsd:annotation>
91
92
  <xsd:include schemaLocation="javaee_7.xsd"/>
93
94
95
<!-- **************************************************** -->
96
97
  <xsd:complexType name="jsp-configType">
98
    <xsd:annotation>
99
      <xsd:documentation>
100
101
        The jsp-configType is used to provide global configuration
102
        information for the JSP files in a web application. It has
103
        two subelements, taglib and jsp-property-group.
104
105
      </xsd:documentation>
106
    </xsd:annotation>
107
    <xsd:sequence>
108
      <xsd:element name="taglib"
109
                   type="javaee:taglibType"
110
                   minOccurs="0"
111
                   maxOccurs="unbounded"/>
112
      <xsd:element name="jsp-property-group"
113
                   type="javaee:jsp-property-groupType"
114
                   minOccurs="0"
115
                   maxOccurs="unbounded"/>
116
    </xsd:sequence>
117
    <xsd:attribute name="id"
118
                   type="xsd:ID"/>
119
  </xsd:complexType>
120
121
122
<!-- **************************************************** -->
123
124
  <xsd:complexType name="jsp-fileType">
125
    <xsd:annotation>
126
      <xsd:documentation>
127
128
        The jsp-file element contains the full path to a JSP file
129
        within the web application beginning with a `/'.
130
131
      </xsd:documentation>
132
    </xsd:annotation>
133
    <xsd:simpleContent>
134
      <xsd:restriction base="javaee:pathType"/>
135
    </xsd:simpleContent>
136
  </xsd:complexType>
137
138
139
<!-- **************************************************** -->
140
141
  <xsd:complexType name="jsp-property-groupType">
142
    <xsd:annotation>
143
      <xsd:documentation>
144
145
        The jsp-property-groupType is used to group a number of
146
        files so they can be given global property information.
147
        All files so described are deemed to be JSP files.  The
148
        following additional properties can be described:
149
150
        - Control whether EL is ignored.
151
        - Control whether scripting elements are invalid.
152
        - Indicate pageEncoding information.
153
        - Indicate that a resource is a JSP document (XML).
154
        - Prelude and Coda automatic includes.
155
        - Control whether the character sequence #{ is allowed
156
        when used as a String literal.
157
        - Control whether template text containing only
158
        whitespaces must be removed from the response output.
159
        - Indicate the default contentType information.
160
        - Indicate the default buffering model for JspWriter
161
        - Control whether error should be raised for the use of
162
        undeclared namespaces in a JSP page.
163
164
      </xsd:documentation>
165
    </xsd:annotation>
166
    <xsd:sequence>
167
      <xsd:group ref="javaee:descriptionGroup"/>
168
      <xsd:element name="url-pattern"
169
                   type="javaee:url-patternType"
170
                   maxOccurs="unbounded"/>
171
      <xsd:element name="el-ignored"
172
                   type="javaee:true-falseType"
173
                   minOccurs="0">
174
        <xsd:annotation>
175
          <xsd:documentation>
176
177
            Can be used to easily set the isELIgnored
178
            property of a group of JSP pages.  By default, the
179
            EL evaluation is enabled for Web Applications using
180
            a Servlet 2.4 or greater web.xml, and disabled
181
            otherwise.
182
183
          </xsd:documentation>
184
        </xsd:annotation>
185
      </xsd:element>
186
      <xsd:element name="page-encoding"
187
                   type="javaee:string"
188
                   minOccurs="0">
189
        <xsd:annotation>
190
          <xsd:documentation>
191
192
            The valid values of page-encoding are those of the
193
            pageEncoding page directive.  It is a
194
            translation-time error to name different encodings
195
            in the pageEncoding attribute of the page directive
196
            of a JSP page and in a JSP configuration element
197
            matching the page.  It is also a translation-time
198
            error to name different encodings in the prolog
199
            or text declaration of a document in XML syntax and
200
            in a JSP configuration element matching the document.
201
            It is legal to name the same encoding through
202
            mulitple mechanisms.
203
204
          </xsd:documentation>
205
        </xsd:annotation>
206
      </xsd:element>
207
      <xsd:element name="scripting-invalid"
208
                   type="javaee:true-falseType"
209
                   minOccurs="0">
210
        <xsd:annotation>
211
          <xsd:documentation>
212
213
            Can be used to easily disable scripting in a
214
            group of JSP pages.  By default, scripting is
215
            enabled.
216
217
          </xsd:documentation>
218
        </xsd:annotation>
219
      </xsd:element>
220
      <xsd:element name="is-xml"
221
                   type="javaee:true-falseType"
222
                   minOccurs="0">
223
        <xsd:annotation>
224
          <xsd:documentation>
225
226
            If true, denotes that the group of resources
227
            that match the URL pattern are JSP documents,
228
            and thus must be interpreted as XML documents.
229
            If false, the resources are assumed to not
230
            be JSP documents, unless there is another
231
            property group that indicates otherwise.
232
233
          </xsd:documentation>
234
        </xsd:annotation>
235
      </xsd:element>
236
      <xsd:element name="include-prelude"
237
                   type="javaee:pathType"
238
                   minOccurs="0"
239
                   maxOccurs="unbounded">
240
        <xsd:annotation>
241
          <xsd:documentation>
242
243
            The include-prelude element is a context-relative
244
            path that must correspond to an element in the
245
            Web Application.  When the element is present,
246
            the given path will be automatically included (as
247
            in an include directive) at the beginning of each
248
            JSP page in this jsp-property-group.
249
250
          </xsd:documentation>
251
        </xsd:annotation>
252
      </xsd:element>
253
      <xsd:element name="include-coda"
254
                   type="javaee:pathType"
255
                   minOccurs="0"
256
                   maxOccurs="unbounded">
257
        <xsd:annotation>
258
          <xsd:documentation>
259
260
            The include-coda element is a context-relative
261
            path that must correspond to an element in the
262
            Web Application.  When the element is present,
263
            the given path will be automatically included (as
264
            in an include directive) at the end of each
265
            JSP page in this jsp-property-group.
266
267
          </xsd:documentation>
268
        </xsd:annotation>
269
      </xsd:element>
270
      <xsd:element name="deferred-syntax-allowed-as-literal"
271
                   type="javaee:true-falseType"
272
                   minOccurs="0">
273
        <xsd:annotation>
274
          <xsd:documentation>
275
276
            The character sequence #{ is reserved for EL expressions.
277
            Consequently, a translation error occurs if the #{
278
            character sequence is used as a String literal, unless
279
            this element is enabled (true). Disabled (false) by
280
            default.
281
282
          </xsd:documentation>
283
        </xsd:annotation>
284
      </xsd:element>
285
      <xsd:element name="trim-directive-whitespaces"
286
                   type="javaee:true-falseType"
287
                   minOccurs="0">
288
        <xsd:annotation>
289
          <xsd:documentation>
290
291
            Indicates that template text containing only whitespaces
292
            must be removed from the response output. It has no
293
            effect on JSP documents (XML syntax). Disabled (false)
294
            by default.
295
296
          </xsd:documentation>
297
        </xsd:annotation>
298
      </xsd:element>
299
      <xsd:element name="default-content-type"
300
                   type="javaee:string"
301
                   minOccurs="0">
302
        <xsd:annotation>
303
          <xsd:documentation>
304
305
            The valid values of default-content-type are those of the
306
            contentType page directive.  It specifies the default
307
            response contentType if the page directive does not include
308
            a contentType attribute.
309
310
          </xsd:documentation>
311
        </xsd:annotation>
312
      </xsd:element>
313
      <xsd:element name="buffer"
314
                   type="javaee:string"
315
                   minOccurs="0">
316
        <xsd:annotation>
317
          <xsd:documentation>
318
319
            The valid values of buffer are those of the
320
            buffer page directive.  It specifies if buffering should be
321
            used for the output to response, and if so, the size of the
322
            buffer to use.
323
324
          </xsd:documentation>
325
        </xsd:annotation>
326
      </xsd:element>
327
      <xsd:element name="error-on-undeclared-namespace"
328
                   type="javaee:true-falseType"
329
                   minOccurs="0">
330
        <xsd:annotation>
331
          <xsd:documentation>
332
333
            The default behavior when a tag with unknown namespace is used
334
            in a JSP page (regular syntax) is to silently ignore it.  If
335
            set to true, then an error must be raised during the translation
336
            time when an undeclared tag is used in a JSP page.  Disabled
337
            (false) by default.
338
339
          </xsd:documentation>
340
        </xsd:annotation>
341
      </xsd:element>
342
    </xsd:sequence>
343
    <xsd:attribute name="id"
344
                   type="xsd:ID"/>
345
  </xsd:complexType>
346
347
348
<!-- **************************************************** -->
349
350
  <xsd:complexType name="taglibType">
351
    <xsd:annotation>
352
      <xsd:documentation>
353
354
        The taglibType defines the syntax for declaring in
355
        the deployment descriptor that a tag library is
356
        available to the application.  This can be done
357
        to override implicit map entries from TLD files and
358
        from the container.
359
360
      </xsd:documentation>
361
    </xsd:annotation>
362
    <xsd:sequence>
363
      <xsd:element name="taglib-uri"
364
                   type="javaee:string">
365
        <xsd:annotation>
366
          <xsd:documentation>
367
368
            A taglib-uri element describes a URI identifying a
369
            tag library used in the web application.  The body
370
            of the taglib-uri element may be either an
371
            absolute URI specification, or a relative URI.
372
            There should be no entries in web.xml with the
373
            same taglib-uri value.
374
375
          </xsd:documentation>
376
        </xsd:annotation>
377
      </xsd:element>
378
      <xsd:element name="taglib-location"
379
                   type="javaee:pathType">
380
        <xsd:annotation>
381
          <xsd:documentation>
382
383
            the taglib-location element contains the location
384
            (as a resource relative to the root of the web
385
            application) where to find the Tag Library
386
            Description file for the tag library.
387
388
          </xsd:documentation>
389
        </xsd:annotation>
390
      </xsd:element>
391
    </xsd:sequence>
392
    <xsd:attribute name="id"
393
                   type="xsd:ID"/>
394
  </xsd:complexType>
395
396
</xsd:schema>
(-)java/javax/servlet/jsp/resources/web-jsptaglibrary_2_0.xsd (-989 lines)
Lines 1-989 Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
<!--
3
 Licensed to the Apache Software Foundation (ASF) under one or more
4
  contributor license agreements.  See the NOTICE file distributed with
5
  this work for additional information regarding copyright ownership.
6
  The ASF licenses this file to You under the Apache License, Version 2.0
7
  (the "License"); you may not use this file except in compliance with
8
  the License.  You may obtain a copy of the License at
9
10
      http://www.apache.org/licenses/LICENSE-2.0
11
12
  Unless required by applicable law or agreed to in writing, software
13
  distributed under the License is distributed on an "AS IS" BASIS,
14
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
  See the License for the specific language governing permissions and
16
  limitations under the License.
17
-->
18
<xsd:schema
19
     targetNamespace="http://java.sun.com/xml/ns/j2ee"
20
     xmlns:j2ee="http://java.sun.com/xml/ns/j2ee"
21
     xmlns:xsd="http://www.w3.org/2001/XMLSchema"
22
     xmlns:xml="http://www.w3.org/XML/1998/namespace"
23
     elementFormDefault="qualified"
24
     attributeFormDefault="unqualified"
25
     version="2.0">
26
27
  <xsd:annotation>
28
    <xsd:documentation>
29
      %W% %G%
30
    </xsd:documentation>
31
  </xsd:annotation>
32
  <xsd:annotation>
33
    <xsd:documentation>
34
      <![CDATA[
35
36
        This is the XML Schema for the JSP Taglibrary
37
        descriptor.  All Taglibrary descriptors must
38
        indicate the tag library schema by using the Taglibrary
39
        namespace:
40
41
        http://java.sun.com/xml/ns/j2ee
42
43
        and by indicating the version of the schema by
44
        using the version element as shown below:
45
46
            <taglib xmlns="http://java.sun.com/xml/ns/j2ee"
47
              xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
48
              xsi:schemaLocation="..."
49
              version="2.0">
50
              ...
51
            </taglib>
52
53
        The instance documents may indicate the published
54
        version of the schema using xsi:schemaLocation attribute
55
        for J2EE namespace with the following location:
56
57
        http://java.sun.com/xml/ns/j2ee/web-jsptaglibrary_2_0.xsd
58
59
        ]]>
60
    </xsd:documentation>
61
  </xsd:annotation>
62
63
  <xsd:include schemaLocation="j2ee_1_4.xsd"/>
64
65
66
<!-- **************************************************** -->
67
68
69
  <xsd:element name="taglib" type="j2ee:tldTaglibType">
70
    <xsd:annotation>
71
      <xsd:documentation>
72
73
        The taglib tag is the document root.
74
        The definition of taglib is provided
75
        by the tldTaglibType.
76
77
      </xsd:documentation>
78
    </xsd:annotation>
79
    <xsd:unique name="tag-name-uniqueness">
80
      <xsd:annotation>
81
        <xsd:documentation>
82
83
          The taglib element contains, among other things, tag and
84
          tag-file elements.
85
          The name subelements of these elements must each be unique.
86
87
        </xsd:documentation>
88
      </xsd:annotation>
89
      <xsd:selector xpath="j2ee:tag|j2ee:tag-file"/>
90
      <xsd:field    xpath="j2ee:name"/>
91
    </xsd:unique>
92
93
    <xsd:unique name="function-name-uniqueness">
94
      <xsd:annotation>
95
        <xsd:documentation>
96
97
          The taglib element contains function elements.
98
          The name subelements of these elements must each be unique.
99
100
        </xsd:documentation>
101
      </xsd:annotation>
102
      <xsd:selector xpath="j2ee:function"/>
103
      <xsd:field    xpath="j2ee:name"/>
104
    </xsd:unique>
105
106
  </xsd:element>
107
108
109
<!-- **************************************************** -->
110
111
  <xsd:complexType name="body-contentType">
112
    <xsd:annotation>
113
      <xsd:documentation>
114
115
        Specifies the type of body that is valid for a tag.
116
        This value is used by the JSP container to validate
117
        that a tag invocation has the correct body syntax and
118
        by page composition tools to assist the page author
119
        in providing a valid tag body.
120
121
        There are currently four values specified:
122
123
        tagdependent    The body of the tag is interpreted by the tag
124
                        implementation itself, and is most likely
125
                        in a different "language", e.g embedded SQL
126
                        statements.
127
128
        JSP             The body of the tag contains nested JSP
129
                        syntax.
130
131
        empty           The body must be empty
132
133
        scriptless      The body accepts only template text, EL
134
                        Expressions, and JSP action elements.  No
135
                        scripting elements are allowed.
136
137
      </xsd:documentation>
138
    </xsd:annotation>
139
140
    <xsd:simpleContent>
141
      <xsd:restriction base="j2ee:string">
142
        <xsd:enumeration value="tagdependent"/>
143
        <xsd:enumeration value="JSP"/>
144
        <xsd:enumeration value="empty"/>
145
        <xsd:enumeration value="scriptless"/>
146
      </xsd:restriction>
147
    </xsd:simpleContent>
148
  </xsd:complexType>
149
150
<!-- **************************************************** -->
151
152
  <xsd:complexType name="extensibleType" abstract="true">
153
    <xsd:annotation>
154
      <xsd:documentation>
155
156
        The extensibleType is an abstract base type that is used to
157
        define the type of extension-elements. Instance documents
158
        must substitute a known type to define the extension by
159
        using xsi:type attribute to define the actual type of
160
        extension-elements.
161
162
      </xsd:documentation>
163
    </xsd:annotation>
164
    <xsd:attribute name="id" type="xsd:ID"/>
165
  </xsd:complexType>
166
167
<!-- **************************************************** -->
168
169
  <xsd:complexType name="functionType">
170
    <xsd:annotation>
171
      <xsd:documentation>
172
173
        The function element is used to provide information on each
174
        function in the tag library that is to be exposed to the EL.
175
176
        The function element may have several subelements defining:
177
178
        description         Optional tag-specific information
179
180
        display-name        A short name that is intended to be
181
                            displayed by tools
182
183
        icon                Optional icon element that can be used
184
                            by tools
185
186
        name                A unique name for this function
187
188
        function-class      Provides the name of the Java class that
189
                            implements the function
190
191
        function-signature  Provides the signature, as in the Java
192
                            Language Specification, of the Java
193
                            method that is to be used to implement
194
                            the function.
195
196
        example             Optional informal description of an
197
                            example of a use of this function
198
199
        function-extension  Zero or more extensions that provide extra
200
                            information about this function, for tool
201
                            consumption
202
203
      </xsd:documentation>
204
    </xsd:annotation>
205
206
    <xsd:sequence>
207
      <xsd:group ref="j2ee:descriptionGroup"/>
208
      <xsd:element name="name"
209
                   type="j2ee:tld-canonical-nameType">
210
        <xsd:annotation>
211
          <xsd:documentation>
212
213
            A unique name for this function.
214
215
          </xsd:documentation>
216
        </xsd:annotation>
217
      </xsd:element>
218
      <xsd:element name="function-class"
219
                   type="j2ee:fully-qualified-classType">
220
        <xsd:annotation>
221
          <xsd:documentation>
222
223
            Provides the fully-qualified class name of the Java
224
            class containing the static method that implements
225
            the function.
226
227
          </xsd:documentation>
228
        </xsd:annotation>
229
230
      </xsd:element>
231
      <xsd:element name="function-signature"
232
                   type="j2ee:string">
233
        <xsd:annotation>
234
          <xsd:documentation>
235
236
            Provides the signature, of the static Java method that is
237
            to be used to implement the function.  The syntax of the
238
            function-signature element is as follows:
239
240
                FunctionSignature ::= ReturnType S MethodName S?
241
                                      '(' S? Parameters? S? ')'
242
243
                ReturnType        ::= Type
244
245
                MethodName        ::= Identifier
246
247
                Parameters        ::=   Parameter
248
                                      | ( Parameter S? ',' S? Parameters )
249
250
                Parameter         ::= Type
251
252
                Where:
253
254
                     * Type is a basic type or a fully qualified Java class name
255
                      (including package name), as per the 'Type' production
256
                      in the Java Language Specification, Second Edition,
257
                      Chapter 18.
258
259
                    * Identifier is a Java identifier, as per the 'Identifier'
260
                      production in the Java Language Specification, Second
261
                      Edition, Chapter 18.
262
263
            Example:
264
265
            java.lang.String nickName( java.lang.String, int )
266
267
          </xsd:documentation>
268
        </xsd:annotation>
269
270
      </xsd:element>
271
      <xsd:element name="example"
272
                   type="j2ee:xsdStringType"
273
                   minOccurs="0">
274
        <xsd:annotation>
275
          <xsd:documentation>
276
277
            The example element contains an informal description
278
            of an example of the use of this function.
279
280
          </xsd:documentation>
281
        </xsd:annotation>
282
283
      </xsd:element>
284
      <xsd:element name="function-extension"
285
                   type="j2ee:tld-extensionType"
286
                   minOccurs="0"
287
                   maxOccurs="unbounded">
288
        <xsd:annotation>
289
          <xsd:documentation>
290
291
            Function extensions are for tool use only and must not affect
292
            the behavior of a container.
293
294
          </xsd:documentation>
295
        </xsd:annotation>
296
      </xsd:element>
297
    </xsd:sequence>
298
    <xsd:attribute name="id" type="xsd:ID"/>
299
  </xsd:complexType>
300
301
<!-- **************************************************** -->
302
303
  <xsd:complexType name="tagFileType">
304
    <xsd:annotation>
305
      <xsd:documentation>
306
307
        Defines an action in this tag library that is implemented
308
        as a .tag file.
309
310
        The tag-file element has two required subelements:
311
312
        description       Optional tag-specific information
313
314
        display-name      A short name that is intended to be
315
                          displayed by tools
316
317
        icon              Optional icon element that can be used
318
                          by tools
319
320
        name              The unique action name
321
322
        path              Where to find the .tag file implementing this
323
                          action, relative to the root of the web
324
                          application or the root of the JAR file for a
325
                          tag library packaged in a JAR.  This must
326
                          begin with /WEB-INF/tags if the .tag file
327
                          resides in the WAR, or /META-INF/tags if the
328
                          .tag file resides in a JAR.
329
330
        example           Optional informal description of an
331
                          example of a use of this tag
332
333
        tag-extension     Zero or more extensions that provide extra
334
                          information about this tag, for tool
335
                          consumption
336
337
      </xsd:documentation>
338
    </xsd:annotation>
339
340
    <xsd:sequence>
341
      <xsd:group ref="j2ee:descriptionGroup"/>
342
      <xsd:element name="name"
343
                   type="j2ee:tld-canonical-nameType"/>
344
      <xsd:element name="path"
345
                   type="j2ee:pathType"/>
346
      <xsd:element name="example"
347
                   type="j2ee:xsdStringType"
348
                   minOccurs="0">
349
        <xsd:annotation>
350
          <xsd:documentation>
351
352
            The example element contains an informal description
353
            of an example of the use of a tag.
354
355
          </xsd:documentation>
356
        </xsd:annotation>
357
358
      </xsd:element>
359
      <xsd:element name="tag-extension"
360
                   type="j2ee:tld-extensionType"
361
                   minOccurs="0"
362
                   maxOccurs="unbounded">
363
        <xsd:annotation>
364
          <xsd:documentation>
365
366
            Tag extensions are for tool use only and must not affect
367
            the behavior of a container.
368
369
          </xsd:documentation>
370
        </xsd:annotation>
371
      </xsd:element>
372
    </xsd:sequence>
373
    <xsd:attribute name="id" type="xsd:ID"/>
374
  </xsd:complexType>
375
376
<!-- **************************************************** -->
377
378
  <xsd:complexType name="tagType">
379
    <xsd:annotation>
380
      <xsd:documentation>
381
382
        The tag defines a unique tag in this tag library.  It has one
383
        attribute, id.
384
385
        The tag element may have several subelements defining:
386
387
        description       Optional tag-specific information
388
389
        display-name      A short name that is intended to be
390
                          displayed by tools
391
392
        icon              Optional icon element that can be used
393
                          by tools
394
395
        name              The unique action name
396
397
        tag-class         The tag handler class implementing
398
                          javax.servlet.jsp.tagext.JspTag
399
400
        tei-class         An optional subclass of
401
                          javax.servlet.jsp.tagext.TagExtraInfo
402
403
        body-content      The body content type
404
405
        variable          Optional scripting variable information
406
407
        attribute         All attributes of this action that are
408
                          evaluated prior to invocation.
409
410
        dynamic-attributes Whether this tag supports additional
411
                           attributes with dynamic names.  If
412
                           true, the tag-class must implement the
413
                           javax.servlet.jsp.tagext.DynamicAttributes
414
                           interface.  Defaults to false.
415
416
        example           Optional informal description of an
417
                          example of a use of this tag
418
419
        tag-extension     Zero or more extensions that provide extra
420
                          information about this tag, for tool
421
                          consumption
422
423
      </xsd:documentation>
424
    </xsd:annotation>
425
426
    <xsd:sequence>
427
      <xsd:group ref="j2ee:descriptionGroup"/>
428
      <xsd:element name="name"
429
                   type="j2ee:tld-canonical-nameType"/>
430
      <xsd:element name="tag-class"
431
                   type="j2ee:fully-qualified-classType">
432
        <xsd:annotation>
433
          <xsd:documentation>
434
435
            Defines the subclass of javax.serlvet.jsp.tagext.JspTag
436
            that implements the request time semantics for
437
            this tag. (required)
438
439
          </xsd:documentation>
440
        </xsd:annotation>
441
442
      </xsd:element>
443
      <xsd:element name="tei-class"
444
                   type="j2ee:fully-qualified-classType"
445
                   minOccurs="0">
446
        <xsd:annotation>
447
          <xsd:documentation>
448
449
            Defines the subclass of javax.servlet.jsp.tagext.TagExtraInfo
450
            for this tag. (optional)
451
452
            If this is not given, the class is not consulted at
453
            translation time.
454
455
          </xsd:documentation>
456
        </xsd:annotation>
457
      </xsd:element>
458
      <xsd:element name="body-content"
459
                   type="j2ee:body-contentType">
460
        <xsd:annotation>
461
          <xsd:documentation>
462
463
            Specifies the format for the body of this tag.
464
            The default in JSP 1.2 was "JSP" but because this
465
            is an invalid setting for simple tag handlers, there
466
            is no longer a default in JSP 2.0.  A reasonable
467
            default for simple tag handlers is "scriptless" if
468
            the tag can have a body.
469
470
          </xsd:documentation>
471
        </xsd:annotation>
472
      </xsd:element>
473
      <xsd:element name="variable"
474
                   type="j2ee:variableType"
475
                   minOccurs="0" maxOccurs="unbounded"/>
476
      <xsd:element name="attribute"
477
                   type="j2ee:tld-attributeType"
478
                   minOccurs="0" maxOccurs="unbounded"/>
479
      <xsd:element name="dynamic-attributes"
480
                   type="j2ee:generic-booleanType"
481
                   minOccurs="0"/>
482
      <xsd:element name="example"
483
                   type="j2ee:xsdStringType"
484
                   minOccurs="0">
485
        <xsd:annotation>
486
          <xsd:documentation>
487
488
            The example element contains an informal description
489
            of an example of the use of a tag.
490
491
          </xsd:documentation>
492
        </xsd:annotation>
493
494
      </xsd:element>
495
      <xsd:element name="tag-extension"
496
                   type="j2ee:tld-extensionType"
497
                   minOccurs="0"
498
                   maxOccurs="unbounded">
499
        <xsd:annotation>
500
          <xsd:documentation>
501
502
            Tag extensions are for tool use only and must not affect
503
            the behavior of a container.
504
505
          </xsd:documentation>
506
        </xsd:annotation>
507
      </xsd:element>
508
    </xsd:sequence>
509
    <xsd:attribute name="id" type="xsd:ID"/>
510
  </xsd:complexType>
511
512
<!-- **************************************************** -->
513
514
  <xsd:complexType name="tld-attributeType">
515
    <xsd:annotation>
516
      <xsd:documentation>
517
518
        The attribute element defines an attribute for the nesting
519
        tag.  The attributre element may have several subelements
520
        defining:
521
522
        description     a description of the attribute
523
524
        name            the name of the attribute
525
526
        required        whether the attribute is required or
527
                        optional
528
529
        rtexprvalue     whether the attribute is a runtime attribute
530
531
        type            the type of the attributes
532
533
        fragment        whether this attribute is a fragment
534
535
      </xsd:documentation>
536
    </xsd:annotation>
537
    <xsd:sequence>
538
      <xsd:element name="description"
539
                   type="j2ee:descriptionType"
540
                   minOccurs="0" maxOccurs="unbounded"/>
541
      <xsd:element name="name"
542
                   type="j2ee:java-identifierType"/>
543
      <xsd:element name="required"
544
                   type="j2ee:generic-booleanType"
545
                   minOccurs="0">
546
        <xsd:annotation>
547
          <xsd:documentation>
548
549
            Defines if the nesting attribute is required or
550
            optional.
551
552
            If not present then the default is "false", i.e
553
            the attribute is optional.
554
555
          </xsd:documentation>
556
        </xsd:annotation>
557
      </xsd:element>
558
559
      <xsd:choice>
560
        <xsd:sequence>
561
          <xsd:element name="rtexprvalue"
562
                       type="j2ee:generic-booleanType"
563
                       minOccurs="0">
564
            <xsd:annotation>
565
              <xsd:documentation>
566
567
                Defines if the nesting attribute can have scriptlet
568
                expressions as a value, i.e the value of the
569
                attribute may be dynamically calculated at request
570
                time, as opposed to a static value determined at
571
                translation time.
572
573
                If not present then the default is "false", i.e the
574
                attribute has a static value
575
576
              </xsd:documentation>
577
            </xsd:annotation>
578
579
          </xsd:element>
580
          <xsd:element name="type"
581
                       type="j2ee:fully-qualified-classType"
582
                       minOccurs="0">
583
            <xsd:annotation>
584
              <xsd:documentation>
585
586
                Defines the Java type of the attributes value.  For
587
                static values (those determined at translation time)
588
                the type is always java.lang.String.
589
590
              </xsd:documentation>
591
            </xsd:annotation>
592
          </xsd:element>
593
        </xsd:sequence>
594
        <xsd:element name="fragment"
595
                     type="j2ee:generic-booleanType"
596
                     minOccurs="0">
597
          <xsd:annotation>
598
            <xsd:documentation>
599
600
              "true" if this attribute is of type
601
              javax.jsp.tagext.JspFragment, representing dynamic
602
              content that can be re-evaluated as many times
603
              as needed by the tag handler.  If omitted or "false",
604
              the default is still type="java.lang.String"
605
606
            </xsd:documentation>
607
          </xsd:annotation>
608
        </xsd:element>
609
      </xsd:choice>
610
    </xsd:sequence>
611
    <xsd:attribute name="id" type="xsd:ID"/>
612
  </xsd:complexType>
613
614
<!-- **************************************************** -->
615
616
  <xsd:complexType name="tld-canonical-nameType">
617
618
    <xsd:annotation>
619
      <xsd:documentation>
620
621
        Defines the canonical name of a tag or attribute being
622
        defined.
623
624
        The name must conform to the lexical rules for an NMTOKEN.
625
626
      </xsd:documentation>
627
    </xsd:annotation>
628
629
    <xsd:simpleContent>
630
      <xsd:restriction base="j2ee:xsdNMTOKENType"/>
631
    </xsd:simpleContent>
632
  </xsd:complexType>
633
634
<!-- **************************************************** -->
635
636
  <xsd:complexType name="tld-extensionType">
637
    <xsd:annotation>
638
      <xsd:documentation>
639
640
        The tld-extensionType is used to indicate
641
        extensions to a specific TLD element.
642
643
        It is used by elements to designate an extension block
644
        that is targeted to a specific extension designated by
645
        a set of extension elements that are declared by a
646
        namespace. The namespace identifies the extension to
647
        the tool that processes the extension.
648
649
        The type of the extension-element is abstract. Therefore,
650
        a concrete type must be specified by the TLD using
651
        xsi:type attribute for each extension-element.
652
653
      </xsd:documentation>
654
    </xsd:annotation>
655
656
    <xsd:sequence>
657
      <xsd:element name="extension-element"
658
                   type="j2ee:extensibleType"
659
                   maxOccurs="unbounded"/>
660
    </xsd:sequence>
661
662
    <xsd:attribute name="namespace"
663
                   use="required"
664
                   type="xsd:anyURI"/>
665
    <xsd:attribute name="id" type="xsd:ID"/>
666
667
  </xsd:complexType>
668
669
<!-- **************************************************** -->
670
671
  <xsd:complexType name="tldTaglibType">
672
    <xsd:annotation>
673
      <xsd:documentation>
674
675
        The taglib tag is the document root, it defines:
676
677
        description     a simple string describing the "use" of this taglib,
678
                        should be user discernable
679
680
        display-name    the display-name element contains a
681
                        short name that is intended to be displayed
682
                        by tools
683
684
        icon            optional icon that can be used by tools
685
686
        tlib-version    the version of the tag library implementation
687
688
        short-name      a simple default short name that could be
689
                        used by a JSP authoring tool to create
690
                        names with a mnemonic value; for example,
691
                        the it may be used as the prefered prefix
692
                        value in taglib directives
693
694
        uri             a uri uniquely identifying this taglib
695
696
        validator       optional TagLibraryValidator information
697
698
        listener        optional event listener specification
699
700
        tag             tags in this tag library
701
702
        tag-file        tag files in this tag library
703
704
        function        zero or more EL functions defined in this
705
                        tag library
706
707
        taglib-extension zero or more extensions that provide extra
708
                        information about this taglib, for tool
709
                        consumption
710
711
      </xsd:documentation>
712
    </xsd:annotation>
713
    <xsd:sequence>
714
      <xsd:group ref="j2ee:descriptionGroup"/>
715
      <xsd:element name="tlib-version"
716
                   type="j2ee:dewey-versionType">
717
        <xsd:annotation>
718
          <xsd:documentation>
719
720
            Describes this version (number) of the taglibrary.
721
            It is described as a dewey decimal.
722
723
          </xsd:documentation>
724
        </xsd:annotation>
725
726
      </xsd:element>
727
728
      <xsd:element name="short-name"
729
                   type="j2ee:tld-canonical-nameType">
730
        <xsd:annotation>
731
          <xsd:documentation>
732
733
            Defines a simple default name that could be used by
734
            a JSP authoring tool to create names with a
735
            mnemonicvalue; for example, it may be used as the
736
            preferred prefix value in taglib directives.  Do
737
            not use white space, and do not start with digits
738
            or underscore.
739
740
          </xsd:documentation>
741
        </xsd:annotation>
742
743
      </xsd:element>
744
      <xsd:element name="uri"
745
                   type="j2ee:xsdAnyURIType"
746
                   minOccurs="0">
747
        <xsd:annotation>
748
          <xsd:documentation>
749
750
            Defines a public URI that uniquely identifies this
751
            version of the taglibrary.  Leave it empty if it
752
            does not apply.
753
754
          </xsd:documentation>
755
        </xsd:annotation>
756
757
      </xsd:element>
758
      <xsd:element name="validator"
759
                   type="j2ee:validatorType"
760
                   minOccurs="0">
761
      </xsd:element>
762
      <xsd:element name="listener"
763
                   type="j2ee:listenerType"
764
                   minOccurs="0" maxOccurs="unbounded">
765
      </xsd:element>
766
      <xsd:element name="tag"
767
                   type="j2ee:tagType"
768
                   minOccurs="0"
769
                   maxOccurs="unbounded"/>
770
      <xsd:element name="tag-file"
771
                   type="j2ee:tagFileType"
772
                   minOccurs="0"
773
                   maxOccurs="unbounded"/>
774
      <xsd:element name="function"
775
                   type="j2ee:functionType"
776
                   minOccurs="0"
777
                   maxOccurs="unbounded"/>
778
      <xsd:element name="taglib-extension"
779
                   type="j2ee:tld-extensionType"
780
                   minOccurs="0"
781
                   maxOccurs="unbounded">
782
        <xsd:annotation>
783
          <xsd:documentation>
784
785
            Taglib extensions are for tool use only and must not affect
786
            the behavior of a container.
787
788
          </xsd:documentation>
789
        </xsd:annotation>
790
      </xsd:element>
791
    </xsd:sequence>
792
    <xsd:attribute name="version"
793
                   type="j2ee:dewey-versionType"
794
                   fixed="2.0"
795
                   use="required">
796
      <xsd:annotation>
797
        <xsd:documentation>
798
799
          Describes the JSP version (number) this taglibrary
800
          requires in order to function (dewey decimal)
801
802
        </xsd:documentation>
803
      </xsd:annotation>
804
805
    </xsd:attribute>
806
    <xsd:attribute name="id" type="xsd:ID"/>
807
  </xsd:complexType>
808
809
<!-- **************************************************** -->
810
811
  <xsd:complexType name="validatorType">
812
    <xsd:annotation>
813
      <xsd:documentation>
814
815
        A validator that can be used to validate
816
        the conformance of a JSP page to using this tag library is
817
        defined by a validatorType.
818
819
      </xsd:documentation>
820
    </xsd:annotation>
821
822
    <xsd:sequence>
823
      <xsd:element name="description"
824
                   type="j2ee:descriptionType"
825
                   minOccurs="0"
826
                   maxOccurs="unbounded"/>
827
      <xsd:element name="validator-class"
828
                   type="j2ee:fully-qualified-classType">
829
        <xsd:annotation>
830
          <xsd:documentation>
831
832
            Defines the TagLibraryValidator class that can be used
833
            to validate the conformance of a JSP page to using this
834
            tag library.
835
836
          </xsd:documentation>
837
        </xsd:annotation>
838
      </xsd:element>
839
      <xsd:element name="init-param"
840
                   type="j2ee:param-valueType"
841
                   minOccurs="0" maxOccurs="unbounded">
842
        <xsd:annotation>
843
          <xsd:documentation>
844
845
            The init-param element contains a name/value pair as an
846
            initialization param.
847
848
          </xsd:documentation>
849
        </xsd:annotation>
850
851
      </xsd:element>
852
853
    </xsd:sequence>
854
    <xsd:attribute name="id" type="xsd:ID"/>
855
  </xsd:complexType>
856
857
<!-- **************************************************** -->
858
859
  <xsd:complexType name="variable-scopeType">
860
    <xsd:annotation>
861
      <xsd:documentation>
862
863
        This type defines scope of the scripting variable.  See
864
        TagExtraInfo for details.  The allowed values are,
865
        "NESTED", "AT_BEGIN" and "AT_END".
866
867
      </xsd:documentation>
868
    </xsd:annotation>
869
870
    <xsd:simpleContent>
871
      <xsd:restriction base="j2ee:string">
872
        <xsd:enumeration value="NESTED"/>
873
        <xsd:enumeration value="AT_BEGIN"/>
874
        <xsd:enumeration value="AT_END"/>
875
      </xsd:restriction>
876
    </xsd:simpleContent>
877
  </xsd:complexType>
878
879
<!-- **************************************************** -->
880
881
  <xsd:complexType name="variableType">
882
    <xsd:annotation>
883
      <xsd:documentation>
884
885
        The variableType provides information on the scripting
886
        variables defined by using this tag.  It is a (translation
887
        time) error for a tag that has one or more variable
888
        subelements to have a TagExtraInfo class that returns a
889
        non-null value from a call to getVariableInfo().
890
891
        The subelements of variableType are of the form:
892
893
        description              Optional description of this
894
                                 variable
895
896
        name-given               The variable name as a constant
897
898
        name-from-attribute      The name of an attribute whose
899
                                 (translation time) value will
900
                                 give the name of the
901
                                 variable.  One of name-given or
902
                                 name-from-attribute is required.
903
904
        variable-class           Name of the class of the variable.
905
                                 java.lang.String is default.
906
907
        declare                  Whether the variable is declared
908
                                 or not.  True is the default.
909
910
        scope                    The scope of the scripting varaible
911
                                 defined.  NESTED is default.
912
913
      </xsd:documentation>
914
    </xsd:annotation>
915
916
    <xsd:sequence>
917
      <xsd:element name="description"
918
                   type="j2ee:descriptionType"
919
                   minOccurs="0" maxOccurs="unbounded"/>
920
      <xsd:choice>
921
        <xsd:element name="name-given"
922
                     type="j2ee:java-identifierType">
923
          <xsd:annotation>
924
            <xsd:documentation>
925
926
              The name for the scripting variable.
927
928
            </xsd:documentation>
929
          </xsd:annotation>
930
        </xsd:element>
931
932
        <xsd:element name="name-from-attribute"
933
                     type="j2ee:java-identifierType">
934
          <xsd:annotation>
935
            <xsd:documentation>
936
937
              The name of an attribute whose
938
              (translation-time) value will give the name of
939
              the variable.
940
941
            </xsd:documentation>
942
          </xsd:annotation>
943
        </xsd:element>
944
      </xsd:choice>
945
      <xsd:element name="variable-class"
946
                   type="j2ee:fully-qualified-classType"
947
                   minOccurs="0">
948
        <xsd:annotation>
949
          <xsd:documentation>
950
951
            The optional name of the class for the scripting
952
            variable.  The default is java.lang.String.
953
954
          </xsd:documentation>
955
        </xsd:annotation>
956
957
      </xsd:element>
958
959
      <xsd:element name="declare"
960
                   type="j2ee:generic-booleanType"
961
                   minOccurs="0">
962
963
        <xsd:annotation>
964
          <xsd:documentation>
965
966
            Whether the scripting variable is to be defined
967
            or not.  See TagExtraInfo for details.  This
968
            element is optional and "true" is the default.
969
970
          </xsd:documentation>
971
        </xsd:annotation>
972
      </xsd:element>
973
      <xsd:element name="scope"
974
                   type="j2ee:variable-scopeType"
975
                   minOccurs="0">
976
        <xsd:annotation>
977
          <xsd:documentation>
978
979
            The element is optional and "NESTED" is the default.
980
981
          </xsd:documentation>
982
        </xsd:annotation>
983
      </xsd:element>
984
    </xsd:sequence>
985
    <xsd:attribute name="id" type="xsd:ID"/>
986
  </xsd:complexType>
987
988
</xsd:schema>
989
(-)java/javax/servlet/jsp/resources/web-jsptaglibrary_2_1.xsd (-229 lines)
Lines 1-229 Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
3
<!--
4
  Licensed to the Apache Software Foundation (ASF) under one or more
5
  contributor license agreements.  See the NOTICE file distributed with
6
  this work for additional information regarding copyright ownership.
7
  The ASF licenses this file to You under the Apache License, Version 2.0
8
  (the "License"); you may not use this file except in compliance with
9
  the License.  You may obtain a copy of the License at
10
11
      http://www.apache.org/licenses/LICENSE-2.0
12
13
  Unless required by applicable law or agreed to in writing, software
14
  distributed under the License is distributed on an "AS IS" BASIS,
15
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
  See the License for the specific language governing permissions and
17
  limitations under the License.
18
-->
19
20
<!--
21
  ** This XSD contains only the programatic elements required for an implementation.
22
  ** For the XSD from Sun that includes documentation and other copyrighted information
23
  ** please refer to http://java.sun.com/xml/ns/javaee/web-jsptaglibrary_2_1.xsd for a fully documented and latest
24
  **  XSD.
25
-->
26
27
<xsd:schema targetNamespace="http://java.sun.com/xml/ns/javaee"
28
            xmlns:javaee="http://java.sun.com/xml/ns/javaee"
29
            xmlns:xsd="http://www.w3.org/2001/XMLSchema"
30
            elementFormDefault="qualified"
31
            attributeFormDefault="unqualified"
32
            version="2.1">
33
34
    <xsd:include schemaLocation="javaee_5.xsd" />
35
36
    <xsd:element name="taglib" type="javaee:tldTaglibType">
37
        <xsd:unique name="tag-name-uniqueness">
38
            <xsd:selector xpath="javaee:tag|javaee:tag-file" />
39
            <xsd:field xpath="javaee:name" />
40
        </xsd:unique>
41
42
        <xsd:unique name="function-name-uniqueness">
43
            <xsd:selector xpath="javaee:function" />
44
            <xsd:field xpath="javaee:name" />
45
        </xsd:unique>
46
    </xsd:element>
47
48
    <xsd:complexType name="body-contentType">
49
        <xsd:simpleContent>
50
            <xsd:restriction base="javaee:string">
51
                <xsd:enumeration value="tagdependent" />
52
                <xsd:enumeration value="JSP" />
53
                <xsd:enumeration value="empty" />
54
                <xsd:enumeration value="scriptless" />
55
            </xsd:restriction>
56
        </xsd:simpleContent>
57
    </xsd:complexType>
58
59
    <xsd:complexType name="extensibleType" abstract="true">
60
        <xsd:attribute name="id" type="xsd:ID" />
61
    </xsd:complexType>
62
63
    <xsd:complexType name="functionType">
64
        <xsd:sequence>
65
            <xsd:group ref="javaee:descriptionGroup" />
66
            <xsd:element name="name" type="javaee:tld-canonical-nameType"></xsd:element>
67
            <xsd:element name="function-class" type="javaee:fully-qualified-classType"></xsd:element>
68
            <xsd:element name="function-signature" type="javaee:string"></xsd:element>
69
            <xsd:element name="example" type="javaee:xsdStringType" minOccurs="0"></xsd:element>
70
            <xsd:element name="function-extension" type="javaee:tld-extensionType" minOccurs="0" maxOccurs="unbounded"></xsd:element>
71
72
        </xsd:sequence>
73
        <xsd:attribute name="id" type="xsd:ID" />
74
    </xsd:complexType>
75
76
    <xsd:complexType name="tagFileType">
77
        <xsd:sequence>
78
            <xsd:group ref="javaee:descriptionGroup" />
79
            <xsd:element name="name" type="javaee:tld-canonical-nameType" />
80
            <xsd:element name="path" type="javaee:pathType" />
81
            <xsd:element name="example" type="javaee:xsdStringType" minOccurs="0"></xsd:element>
82
            <xsd:element name="tag-extension" type="javaee:tld-extensionType" minOccurs="0" maxOccurs="unbounded"></xsd:element>
83
        </xsd:sequence>
84
        <xsd:attribute name="id" type="xsd:ID" />
85
    </xsd:complexType>
86
87
    <xsd:complexType name="tagType">
88
        <xsd:sequence>
89
            <xsd:group ref="javaee:descriptionGroup" />
90
            <xsd:element name="name" type="javaee:tld-canonical-nameType" />
91
            <xsd:element name="tag-class" type="javaee:fully-qualified-classType"></xsd:element>
92
            <xsd:element name="tei-class" type="javaee:fully-qualified-classType" minOccurs="0"></xsd:element>
93
            <xsd:element name="body-content" type="javaee:body-contentType"></xsd:element>
94
            <xsd:element name="variable" type="javaee:variableType" minOccurs="0" maxOccurs="unbounded" />
95
            <xsd:element name="attribute" type="javaee:tld-attributeType" minOccurs="0" maxOccurs="unbounded" />
96
            <xsd:element name="dynamic-attributes" type="javaee:generic-booleanType" minOccurs="0" />
97
            <xsd:element name="example" type="javaee:xsdStringType" minOccurs="0" />
98
            <xsd:element name="tag-extension" type="javaee:tld-extensionType" minOccurs="0" maxOccurs="unbounded" />
99
        </xsd:sequence>
100
        <xsd:attribute name="id" type="xsd:ID" />
101
    </xsd:complexType>
102
103
    <xsd:complexType name="tld-attributeType">
104
        <xsd:sequence>
105
            <xsd:element name="description" type="javaee:descriptionType" minOccurs="0" maxOccurs="unbounded" />
106
107
            <xsd:element name="name" type="javaee:java-identifierType" />
108
            <xsd:element name="required" type="javaee:generic-booleanType" minOccurs="0"></xsd:element>
109
            <xsd:choice>
110
111
                <xsd:sequence>
112
                    <xsd:sequence minOccurs="0">
113
                        <xsd:element name="rtexprvalue" type="javaee:generic-booleanType"></xsd:element>
114
115
                        <xsd:element name="type" type="javaee:fully-qualified-classType" minOccurs="0"></xsd:element>
116
                    </xsd:sequence>
117
118
                    <xsd:choice>
119
                        <xsd:element name="deferred-value" type="javaee:tld-deferred-valueType" minOccurs="0"></xsd:element>
120
                        <xsd:element name="deferred-method" type="javaee:tld-deferred-methodType" minOccurs="0"></xsd:element>
121
                    </xsd:choice>
122
                </xsd:sequence>
123
124
                <xsd:element name="fragment" type="javaee:generic-booleanType" minOccurs="0"></xsd:element>
125
126
            </xsd:choice>
127
128
        </xsd:sequence>
129
        <xsd:attribute name="id" type="xsd:ID" />
130
    </xsd:complexType>
131
132
    <xsd:complexType name="tld-canonical-nameType">
133
        <xsd:simpleContent>
134
            <xsd:restriction base="javaee:xsdNMTOKENType" />
135
        </xsd:simpleContent>
136
    </xsd:complexType>
137
138
    <xsd:complexType name="tld-deferred-methodType">
139
        <xsd:sequence>
140
            <xsd:element name="method-signature" type="javaee:string" minOccurs="0"></xsd:element>
141
        </xsd:sequence>
142
143
        <xsd:attribute name="id" type="xsd:ID" />
144
145
    </xsd:complexType>
146
147
    <xsd:complexType name="tld-deferred-valueType">
148
149
        <xsd:sequence>
150
            <xsd:element name="type" type="javaee:fully-qualified-classType" minOccurs="0"></xsd:element>
151
152
        </xsd:sequence>
153
154
        <xsd:attribute name="id" type="xsd:ID" />
155
    </xsd:complexType>
156
157
    <xsd:complexType name="tld-extensionType">
158
        <xsd:sequence>
159
            <xsd:element name="extension-element" type="javaee:extensibleType" maxOccurs="unbounded" />
160
        </xsd:sequence>
161
162
        <xsd:attribute name="namespace" use="required" type="xsd:anyURI" />
163
        <xsd:attribute name="id" type="xsd:ID" />
164
165
    </xsd:complexType>
166
167
    <xsd:complexType name="tldTaglibType">
168
        <xsd:sequence>
169
            <xsd:group ref="javaee:descriptionGroup" />
170
            <xsd:element name="tlib-version" type="javaee:dewey-versionType"></xsd:element>
171
172
            <xsd:element name="short-name" type="javaee:tld-canonical-nameType">
173
174
            </xsd:element>
175
176
            <xsd:element name="uri" type="javaee:xsdAnyURIType" minOccurs="0">
177
178
            </xsd:element>
179
            <xsd:element name="validator" type="javaee:validatorType" minOccurs="0">
180
181
            </xsd:element>
182
            <xsd:element name="listener" type="javaee:listenerType" minOccurs="0" maxOccurs="unbounded"></xsd:element>
183
            <xsd:element name="tag" type="javaee:tagType" minOccurs="0" maxOccurs="unbounded" />
184
            <xsd:element name="tag-file" type="javaee:tagFileType" minOccurs="0" maxOccurs="unbounded" />
185
            <xsd:element name="function" type="javaee:functionType" minOccurs="0" maxOccurs="unbounded" />
186
            <xsd:element name="taglib-extension" type="javaee:tld-extensionType" minOccurs="0" maxOccurs="unbounded"></xsd:element>
187
        </xsd:sequence>
188
        <xsd:attribute name="version" type="javaee:dewey-versionType" fixed="2.1" use="required"></xsd:attribute>
189
        <xsd:attribute name="id" type="xsd:ID" />
190
    </xsd:complexType>
191
192
    <xsd:complexType name="validatorType">
193
        <xsd:sequence>
194
            <xsd:element name="description" type="javaee:descriptionType" minOccurs="0" maxOccurs="unbounded" />
195
            <xsd:element name="validator-class" type="javaee:fully-qualified-classType"></xsd:element>
196
            <xsd:element name="init-param" type="javaee:param-valueType" minOccurs="0" maxOccurs="unbounded"></xsd:element>
197
198
        </xsd:sequence>
199
        <xsd:attribute name="id" type="xsd:ID" />
200
    </xsd:complexType>
201
202
    <xsd:complexType name="variable-scopeType">
203
        <xsd:simpleContent>
204
205
            <xsd:restriction base="javaee:string">
206
                <xsd:enumeration value="NESTED" />
207
                <xsd:enumeration value="AT_BEGIN" />
208
                <xsd:enumeration value="AT_END" />
209
            </xsd:restriction>
210
        </xsd:simpleContent>
211
    </xsd:complexType>
212
213
    <xsd:complexType name="variableType">
214
        <xsd:sequence>
215
            <xsd:element name="description" type="javaee:descriptionType" minOccurs="0" maxOccurs="unbounded" />
216
217
            <xsd:choice>
218
                <xsd:element name="name-given" type="javaee:java-identifierType"></xsd:element>
219
220
                <xsd:element name="name-from-attribute" type="javaee:java-identifierType"></xsd:element>
221
            </xsd:choice>
222
            <xsd:element name="variable-class" type="javaee:fully-qualified-classType" minOccurs="0"></xsd:element>
223
224
            <xsd:element name="declare" type="javaee:generic-booleanType" minOccurs="0"></xsd:element>
225
            <xsd:element name="scope" type="javaee:variable-scopeType" minOccurs="0"></xsd:element>
226
        </xsd:sequence>
227
        <xsd:attribute name="id" type="xsd:ID" />
228
    </xsd:complexType>
229
</xsd:schema>
(-)java/org/apache/catalina/core/StandardContext.java (-9 / +2 lines)
Lines 123-128 Link Here
123
import org.apache.naming.ContextBindings;
123
import org.apache.naming.ContextBindings;
124
import org.apache.tomcat.InstanceManager;
124
import org.apache.tomcat.InstanceManager;
125
import org.apache.tomcat.JarScanner;
125
import org.apache.tomcat.JarScanner;
126
import org.apache.tomcat.XmlIdentifiers;
126
import org.apache.tomcat.util.ExceptionUtils;
127
import org.apache.tomcat.util.ExceptionUtils;
127
import org.apache.tomcat.util.IntrospectionUtils;
128
import org.apache.tomcat.util.IntrospectionUtils;
128
import org.apache.tomcat.util.scan.StandardJarScanner;
129
import org.apache.tomcat.util.scan.StandardJarScanner;
Lines 5759-5773 Link Here
5759
     */
5760
     */
5760
    @Override
5761
    @Override
5761
    public boolean isServlet22() {
5762
    public boolean isServlet22() {
5762
5763
        return XmlIdentifiers.WEB_22_DTD.equals(publicId);
5763
        if (this.publicId == null)
5764
            return (false);
5765
        if (this.publicId.equals
5766
            (org.apache.catalina.startup.Constants.WebDtdPublicId_22))
5767
            return (true);
5768
        else
5769
            return (false);
5770
5771
    }
5764
    }
5772
5765
5773
    @Override
5766
    @Override
(-)java/org/apache/catalina/deploy/LocalStrings.properties (-2 / +2 lines)
Lines 42-49 Link Here
42
webXml.mergeConflictSessionTrackingMode=The session tracking modes were defined inconsistently in multiple fragments including fragment with name [{0}] located at [{1}]
42
webXml.mergeConflictSessionTrackingMode=The session tracking modes were defined inconsistently in multiple fragments including fragment with name [{0}] located at [{1}]
43
webXml.mergeConflictString=The [{0}] with name [{1}] was defined inconsistently in multiple fragments including fragment with name [{2}] located at [{3}]
43
webXml.mergeConflictString=The [{0}] with name [{1}] was defined inconsistently in multiple fragments including fragment with name [{2}] located at [{3}]
44
webXml.multipleOther=Multiple others entries in ordering
44
webXml.multipleOther=Multiple others entries in ordering
45
webxml.unrecognisedPublicId=The public ID [{0}] did not match any of the known public ID's for web.xml files so the version could not be identified
45
webXml.unrecognisedPublicId=The public ID [{0}] did not match any of the known public ID's for web.xml files so the version could not be identified
46
webXml.version.nfe=Unable to parse [{0}] from the version string [{1}]. This component of the version string will be ignored.
46
webXml.version.unknown=Unknown version string [{0}]. Default version will be used.
47
webXml.wrongFragmentName=Used a wrong fragment name {0} at web.xml absolute-ordering tag!
47
webXml.wrongFragmentName=Used a wrong fragment name {0} at web.xml absolute-ordering tag!
48
48
49
namingResources.cleanupCloseFailed=Failed to invoke method [{0}] for resource [{1}] in container [{2}] so no cleanup was performed for that resource
49
namingResources.cleanupCloseFailed=Failed to invoke method [{0}] for resource [{1}] in container [{2}] so no cleanup was performed for that resource
(-)java/org/apache/catalina/deploy/WebXml.java (-75 / +37 lines)
Lines 32-37 Link Here
32
import javax.servlet.ServletContext;
32
import javax.servlet.ServletContext;
33
import javax.servlet.SessionTrackingMode;
33
import javax.servlet.SessionTrackingMode;
34
34
35
import org.apache.tomcat.XmlIdentifiers;
35
import org.apache.tomcat.util.res.StringManager;
36
import org.apache.tomcat.util.res.StringManager;
36
37
37
/**
38
/**
Lines 127-168 Link Here
127
     * @param version   Values of <code>null</code> will be ignored
128
     * @param version   Values of <code>null</code> will be ignored
128
     */
129
     */
129
    public void setVersion(String version) {
130
    public void setVersion(String version) {
130
        if (version == null) return;
131
        if (version == null) {
131
132
            return;
132
        // Update major and minor version
133
        // Expected format is n.n - allow for any number of digits just in case
134
        String major = null;
135
        String minor = null;
136
        int split = version.indexOf('.');
137
        if (split < 0) {
138
            // Major only
139
            major = version;
140
        } else {
141
            major = version.substring(0, split);
142
            minor = version.substring(split + 1);
143
        }
133
        }
144
        if (major == null || major.length() == 0) {
134
        switch (version) {
145
            majorVersion = 0;
135
            case "2.4":
146
        } else {
136
                majorVersion = 2;
147
            try {
137
                minorVersion = 4;
148
                majorVersion = Integer.parseInt(major);
138
                break;
149
            } catch (NumberFormatException nfe) {
139
            case "2.5":
150
                log.warn(sm.getString("webXml.version.nfe", major, version),
140
                majorVersion = 2;
151
                        nfe);
141
                minorVersion = 5;
152
                majorVersion = 0;
142
                break;
153
            }
143
            case "3.0":
154
        }
144
                majorVersion = 3;
155
156
        if (minor == null || minor.length() == 0) {
157
            minorVersion = 0;
158
        } else {
159
            try {
160
                minorVersion = Integer.parseInt(minor);
161
            } catch (NumberFormatException nfe) {
162
                log.warn(sm.getString("webXml.version.nfe", minor, version),
163
                        nfe);
164
                minorVersion = 0;
145
                minorVersion = 0;
165
            }
146
                break;
147
            case "3.1":
148
                majorVersion = 3;
149
                minorVersion = 1;
150
                break;
151
            default:
152
                log.warn(sm.getString("webXml.version.unknown", version));
166
        }
153
        }
167
    }
154
    }
168
155
Lines 173-220 Link Here
173
    public void setPublicId(String publicId) {
160
    public void setPublicId(String publicId) {
174
        // Update major and minor version
161
        // Update major and minor version
175
        if (publicId == null) {
162
        if (publicId == null) {
176
            // skip
163
            return;
177
        } else if (org.apache.catalina.startup.Constants.WebSchemaPublicId_31.
178
                equalsIgnoreCase(publicId) ||
179
                org.apache.catalina.startup.Constants.WebFragmentSchemaPublicId_31.
180
                equalsIgnoreCase(publicId)) {
181
            majorVersion = 3;
182
            minorVersion = 1;
183
            this.publicId = publicId;
184
        } else if (org.apache.catalina.startup.Constants.WebSchemaPublicId_30.
185
                equalsIgnoreCase(publicId) ||
186
                org.apache.catalina.startup.Constants.WebFragmentSchemaPublicId_30.
187
                equalsIgnoreCase(publicId)) {
188
            majorVersion = 3;
189
            minorVersion = 0;
190
            this.publicId = publicId;
191
        } else if (org.apache.catalina.startup.Constants.WebSchemaPublicId_25.
192
                equalsIgnoreCase(publicId)) {
193
            majorVersion = 2;
194
            minorVersion = 5;
195
            this.publicId = publicId;
196
        } else if (org.apache.catalina.startup.Constants.WebSchemaPublicId_24.
197
                equalsIgnoreCase(publicId)) {
198
            majorVersion = 2;
199
            minorVersion = 4;
200
            this.publicId = publicId;
201
        } else if (org.apache.catalina.startup.Constants.WebDtdPublicId_23.
202
                equalsIgnoreCase(publicId)) {
203
            majorVersion = 2;
204
            minorVersion = 3;
205
            this.publicId = publicId;
206
        } else if (org.apache.catalina.startup.Constants.WebDtdPublicId_22.
207
                equalsIgnoreCase(publicId)) {
208
            majorVersion = 2;
209
            minorVersion = 2;
210
            this.publicId = publicId;
211
        } else if ("datatypes".equals(publicId)) {
212
            // Will occur when validation is enabled and dependencies are
213
            // traced back. Ignore it.
214
        } else {
215
            // Unrecognised publicId
216
            log.warn(sm.getString("webxml.unrecognisedPublicId", publicId));
217
        }
164
        }
165
        switch (publicId) {
166
            case XmlIdentifiers.WEB_22_DTD:
167
                majorVersion = 2;
168
                minorVersion = 2;
169
                this.publicId = publicId;
170
                break;
171
            case XmlIdentifiers.WEB_23_DTD:
172
                majorVersion = 2;
173
                minorVersion = 3;
174
                this.publicId = publicId;
175
                break;
176
            default:
177
                log.warn(sm.getString("webXml.unrecognisedPublicId", publicId));
178
                break;
179
        }
218
    }
180
    }
219
181
220
    // Optional metadata-complete attribute
182
    // Optional metadata-complete attribute
(-)java/org/apache/catalina/startup/Constants.java (-176 lines)
Lines 45-224 Link Here
45
     * @see Tomcat
45
     * @see Tomcat
46
     */
46
     */
47
    public static final String NoDefaultWebXml = "org/apache/catalina/startup/NO_DEFAULT_XML";
47
    public static final String NoDefaultWebXml = "org/apache/catalina/startup/NO_DEFAULT_XML";
48
49
    // J2EE
50
    public static final String J2eeSchemaPublicId_14 =
51
        "j2ee_1_4.xsd";
52
    public static final String J2eeSchemaResourcePath_14 =
53
        "/javax/servlet/resources/j2ee_1_4.xsd";
54
55
    public static final String JavaeeSchemaPublicId_5 =
56
        "javaee_5.xsd";
57
    public static final String JavaeeSchemaResourcePath_5 =
58
        "/javax/servlet/resources/javaee_5.xsd";
59
60
    public static final String JavaeeSchemaPublicId_6 =
61
        "javaee_6.xsd";
62
    public static final String JavaeeSchemaResourcePath_6 =
63
        "/javax/servlet/resources/javaee_6.xsd";
64
65
    public static final String JavaeeSchemaPublicId_7 =
66
        "javaee_7.xsd";
67
    public static final String JavaeeSchemaResourcePath_7 =
68
        "/javax/servlet/resources/javaee_7.xsd";
69
70
71
    // W3C
72
    public static final String W3cSchemaPublicId_10 =
73
        "xml.xsd";
74
    public static final String W3cSchemaResourcePath_10 =
75
        "/javax/servlet/resources/xml.xsd";
76
77
    public static final String W3cSchemaDTDPublicId_10 =
78
        "XMLSchema.dtd";
79
    public static final String W3cSchemaDTDResourcePath_10 =
80
        "/javax/servlet/resources/XMLSchema.dtd";
81
82
    public static final String W3cDatatypesDTDPublicId_10 =
83
        "datatypes.dtd";
84
    public static final String W3cDatatypesDTDResourcePath_10 =
85
        "/javax/servlet/resources/datatypes.dtd";
86
87
88
    // JSP
89
    public static final String JspSchemaPublicId_20 =
90
        "jsp_2_0.xsd";
91
    public static final String JspSchemaResourcePath_20 =
92
        "/javax/servlet/jsp/resources/jsp_2_0.xsd";
93
94
    public static final String JspSchemaPublicId_21 =
95
        "jsp_2_1.xsd";
96
    public static final String JspSchemaResourcePath_21 =
97
        "/javax/servlet/jsp/resources/jsp_2_1.xsd";
98
99
    public static final String JspSchemaPublicId_22 =
100
        "jsp_2_2.xsd";
101
    public static final String JspSchemaResourcePath_22 =
102
        "/javax/servlet/jsp/resources/jsp_2_2.xsd";
103
104
    public static final String JspSchemaPublicId_23 =
105
        "jsp_2_3.xsd";
106
    public static final String JspSchemaResourcePath_23 =
107
        "/javax/servlet/jsp/resources/jsp_2_3.xsd";
108
109
110
    // TLD
111
    public static final String TldDtdPublicId_11 =
112
        "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.1//EN";
113
    public static final String TldDtdResourcePath_11 =
114
        "/javax/servlet/jsp/resources/web-jsptaglibrary_1_1.dtd";
115
116
    public static final String TldDtdPublicId_12 =
117
        "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN";
118
    public static final String TldDtdResourcePath_12 =
119
        "/javax/servlet/jsp/resources/web-jsptaglibrary_1_2.dtd";
120
121
    public static final String TldSchemaPublicId_20 =
122
        "web-jsptaglibrary_2_0.xsd";
123
    public static final String TldSchemaResourcePath_20 =
124
        "/javax/servlet/jsp/resources/web-jsptaglibrary_2_0.xsd";
125
126
    public static final String TldSchemaPublicId_21 =
127
        "web-jsptaglibrary_2_1.xsd";
128
    public static final String TldSchemaResourcePath_21 =
129
        "/javax/servlet/jsp/resources/web-jsptaglibrary_2_1.xsd";
130
131
132
    // web.xml
133
    public static final String WebDtdPublicId_22 =
134
        "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN";
135
    public static final String WebDtdResourcePath_22 =
136
        "/javax/servlet/resources/web-app_2_2.dtd";
137
138
    public static final String WebDtdPublicId_23 =
139
        "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN";
140
    public static final String WebDtdResourcePath_23 =
141
        "/javax/servlet/resources/web-app_2_3.dtd";
142
143
    public static final String WebSchemaPublicId_24 =
144
        "web-app_2_4.xsd";
145
    public static final String WebSchemaResourcePath_24 =
146
        "/javax/servlet/resources/web-app_2_4.xsd";
147
148
    public static final String WebSchemaPublicId_25 =
149
        "web-app_2_5.xsd";
150
    public static final String WebSchemaResourcePath_25 =
151
        "/javax/servlet/resources/web-app_2_5.xsd";
152
153
    public static final String WebSchemaPublicId_30 =
154
        "web-app_3_0.xsd";
155
    public static final String WebSchemaResourcePath_30 =
156
        "/javax/servlet/resources/web-app_3_0.xsd";
157
158
    public static final String WebCommonSchemaPublicId_30 =
159
        "web-common_3_0.xsd";
160
    public static final String WebCommonSchemaResourcePath_30 =
161
        "/javax/servlet/resources/web-common_3_0.xsd";
162
163
    public static final String WebFragmentSchemaPublicId_30 =
164
        "web-fragment_3_0.xsd";
165
    public static final String WebFragmentSchemaResourcePath_30 =
166
        "/javax/servlet/resources/web-fragment_3_0.xsd";
167
168
    public static final String WebSchemaPublicId_31 =
169
        "web-app_3_1.xsd";
170
    public static final String WebSchemaResourcePath_31 =
171
        "/javax/servlet/resources/web-app_3_1.xsd";
172
173
    public static final String WebCommonSchemaPublicId_31 =
174
        "web-common_3_1.xsd";
175
    public static final String WebCommonSchemaResourcePath_31 =
176
        "/javax/servlet/resources/web-common_3_1.xsd";
177
178
    public static final String WebFragmentSchemaPublicId_31 =
179
        "web-fragment_3_1.xsd";
180
    public static final String WebFragmentSchemaResourcePath_31 =
181
        "/javax/servlet/resources/web-fragment_3_1.xsd";
182
183
184
    // Web service
185
    public static final String J2eeWebServiceSchemaPublicId_11 =
186
            "j2ee_web_services_1_1.xsd";
187
    public static final String J2eeWebServiceSchemaResourcePath_11 =
188
            "/javax/servlet/resources/j2ee_web_services_1_1.xsd";
189
190
    public static final String J2eeWebServiceClientSchemaPublicId_11 =
191
            "j2ee_web_services_client_1_1.xsd";
192
    public static final String J2eeWebServiceClientSchemaResourcePath_11 =
193
            "/javax/servlet/resources/j2ee_web_services_client_1_1.xsd";
194
195
    public static final String JavaeeWebServiceSchemaPublicId_12 =
196
        "javaee_web_services_1_2.xsd";
197
    public static final String JavaeeWebServiceSchemaResourcePath_12 =
198
        "/javax/servlet/resources/javaee_web_services_1_2.xsd";
199
200
    public static final String JavaeeWebServiceClientSchemaPublicId_12 =
201
        "javaee_web_services_client_1_2.xsd";
202
    public static final String JavaeeWebServiceClientSchemaResourcePath_12 =
203
        "/javax/servlet/resources/javaee_web_services_client_1_2.xsd";
204
205
    public static final String JavaeeWebServiceSchemaPublicId_13 =
206
        "javaee_web_services_1_3.xsd";
207
    public static final String JavaeeWebServiceSchemaResourcePath_13 =
208
        "/javax/servlet/resources/javaee_web_services_1_3.xsd";
209
210
    public static final String JavaeeWebServiceClientSchemaPublicId_13 =
211
        "javaee_web_services_client_1_3.xsd";
212
    public static final String JavaeeWebServiceClientSchemaResourcePath_13 =
213
        "/javax/servlet/resources/javaee_web_services_client_1_3.xsd";
214
215
    public static final String JavaeeWebServiceSchemaPublicId_14 =
216
        "javaee_web_services_1_4.xsd";
217
    public static final String JavaeeWebServiceSchemaResourcePath_14 =
218
        "/javax/servlet/resources/javaee_web_services_1_4.xsd";
219
220
    public static final String JavaeeWebServiceClientSchemaPublicId_14 =
221
        "javaee_web_services_client_1_4.xsd";
222
    public static final String JavaeeWebServiceClientSchemaResourcePath_14 =
223
        "/javax/servlet/resources/javaee_web_services_client_1_4.xsd";
224
}
48
}
(-)java/org/apache/catalina/startup/DigesterFactory.java (-171 / +47 lines)
Lines 18-30 Link Here
18
18
19
package org.apache.catalina.startup;
19
package org.apache.catalina.startup;
20
20
21
import java.net.URL;
21
import java.util.HashMap;
22
import java.util.Map;
22
23
23
import org.apache.catalina.util.SchemaResolver;
24
import org.apache.tomcat.XmlIdentifiers;
24
import org.apache.juli.logging.Log;
25
import org.apache.juli.logging.LogFactory;
26
import org.apache.tomcat.util.digester.Digester;
25
import org.apache.tomcat.util.digester.Digester;
27
import org.apache.tomcat.util.digester.RuleSet;
26
import org.apache.tomcat.util.digester.RuleSet;
27
import org.apache.tomcat.util.res.LocalResolver;
28
28
29
/**
29
/**
30
 * Wrapper class around the Digester that hide Digester's initialization details
30
 * Wrapper class around the Digester that hide Digester's initialization details
Lines 33-43 Link Here
33
 */
33
 */
34
public class DigesterFactory {
34
public class DigesterFactory {
35
    /**
35
    /**
36
     * The log.
36
     * A resolver for the resources packaged in servlet-api.jar
37
     */
37
     */
38
    private static final Log log = LogFactory.getLog(DigesterFactory.class);
38
    public static final LocalResolver SERVLET_RESOLVER;
39
    static {
40
        Map<String, String> publicIds = new HashMap<>();
41
        Map<String, String> systemIds = new HashMap<>();
39
42
43
        // W3C
44
        publicIds.put(XmlIdentifiers.XSD_10_DTD, urlFor("/javax/servlet/resources/XMLSchema.dtd"));
45
        publicIds.put(XmlIdentifiers.DATATYPES_DTD, urlFor("/javax/servlet/resources/datatypes.dtd"));
46
        systemIds.put(XmlIdentifiers.XML_2001_XSD, urlFor("/javax/servlet/resources/xml.xsd"));
40
47
48
        // from J2EE 1.2
49
        publicIds.put(XmlIdentifiers.WEB_22_DTD, urlFor("/javax/servlet/resources/web-app_2_2.dtd"));
50
        publicIds.put(XmlIdentifiers.TLD_11_DTD, urlFor("/javax/servlet/resources/web-jsptaglibrary_1_1.dtd"));
51
52
        // from J2EE 1.3
53
        publicIds.put(XmlIdentifiers.WEB_23_DTD, urlFor("/javax/servlet/resources/web-app_2_3.dtd"));
54
        publicIds.put(XmlIdentifiers.TLD_12_DTD, urlFor("/javax/servlet/resources/web-jsptaglibrary_1_2.dtd"));
55
56
        // from J2EE 1.4
57
        systemIds.put("http://www.ibm.com/webservices/xsd/j2ee_web_services_client_1_1.xsd",
58
                urlFor("/javax/servlet/resources/j2ee_web_services_client_1_1.xsd"));
59
        systemIds.put(XmlIdentifiers.WEB_24_XSD, urlFor("/javax/servlet/resources/web-app_2_4.xsd"));
60
        systemIds.put(XmlIdentifiers.TLD_20_XSD, urlFor("/javax/servlet/resources/web-jsptaglibrary_2_0.xsd"));
61
62
        // from JavaEE 5
63
        systemIds.put(XmlIdentifiers.WEB_25_XSD, urlFor("/javax/servlet/resources/web-app_2_5.xsd"));
64
        systemIds.put(XmlIdentifiers.TLD_21_XSD, urlFor("/javax/servlet/resources/web-jsptaglibrary_2_1.xsd"));
65
66
        // from JavaEE 6
67
        systemIds.put(XmlIdentifiers.WEB_30_XSD, urlFor("/javax/servlet/resources/web-app_3_0.xsd"));
68
        systemIds.put(XmlIdentifiers.WEB_FRAGMENT_30_XSD, urlFor("/javax/servlet/resources/web-fragment_3_0.xsd"));
69
70
        // from JavaEE 7
71
        systemIds.put(XmlIdentifiers.WEB_31_XSD, urlFor("/javax/servlet/resources/web-app_3_1.xsd"));
72
        systemIds.put(XmlIdentifiers.WEB_FRAGMENT_31_XSD, urlFor("/javax/servlet/resources/web-fragment_3_1.xsd"));
73
74
        SERVLET_RESOLVER = new LocalResolver(publicIds, systemIds);
75
    }
76
77
    private static String urlFor(String file) {
78
        return DigesterFactory.class.getResource(file).toExternalForm();
79
    }
80
41
    /**
81
    /**
42
     * Create a <code>Digester</code> parser.
82
     * Create a <code>Digester</code> parser.
43
     * @param xmlValidation turn on/off xml validation
83
     * @param xmlValidation turn on/off xml validation
Lines 51-225 Link Here
51
        digester.setNamespaceAware(xmlNamespaceAware);
91
        digester.setNamespaceAware(xmlNamespaceAware);
52
        digester.setValidating(xmlValidation);
92
        digester.setValidating(xmlValidation);
53
        digester.setUseContextClassLoader(true);
93
        digester.setUseContextClassLoader(true);
54
94
        digester.setEntityResolver(SERVLET_RESOLVER);
55
        SchemaResolver schemaResolver = new SchemaResolver(digester);
56
        registerLocalSchema(schemaResolver);
57
58
        digester.setEntityResolver(schemaResolver);
59
        if ( rule != null ) {
95
        if ( rule != null ) {
60
            digester.addRuleSet(rule);
96
            digester.addRuleSet(rule);
61
        }
97
        }
62
98
63
        return (digester);
99
        return (digester);
64
    }
100
    }
65
66
67
    /**
68
     * Utilities used to force the parser to use local schema, when available,
69
     * instead of the <code>schemaLocation</code> XML element.
70
     */
71
    protected static void registerLocalSchema(SchemaResolver schemaResolver){
72
        // J2EE
73
        register(Constants.J2eeSchemaResourcePath_14,
74
                 Constants.J2eeSchemaPublicId_14,
75
                 schemaResolver);
76
77
        register(Constants.JavaeeSchemaResourcePath_5,
78
                Constants.JavaeeSchemaPublicId_5,
79
                schemaResolver);
80
81
        register(Constants.JavaeeSchemaResourcePath_6,
82
                Constants.JavaeeSchemaPublicId_6,
83
                schemaResolver);
84
85
        register(Constants.JavaeeSchemaResourcePath_7,
86
                Constants.JavaeeSchemaPublicId_7,
87
                schemaResolver);
88
89
        // W3C
90
        register(Constants.W3cSchemaResourcePath_10,
91
                 Constants.W3cSchemaPublicId_10,
92
                 schemaResolver);
93
94
        register(Constants.W3cSchemaDTDResourcePath_10,
95
                Constants.W3cSchemaDTDPublicId_10,
96
                schemaResolver);
97
98
        register(Constants.W3cDatatypesDTDResourcePath_10,
99
                Constants.W3cDatatypesDTDPublicId_10,
100
                schemaResolver);
101
102
        // JSP
103
        register(Constants.JspSchemaResourcePath_20,
104
                 Constants.JspSchemaPublicId_20,
105
                 schemaResolver);
106
107
        register(Constants.JspSchemaResourcePath_21,
108
                Constants.JspSchemaPublicId_21,
109
                schemaResolver);
110
111
        register(Constants.JspSchemaResourcePath_22,
112
                Constants.JspSchemaPublicId_22,
113
                schemaResolver);
114
115
        register(Constants.JspSchemaResourcePath_23,
116
                Constants.JspSchemaPublicId_23,
117
                schemaResolver);
118
119
        // TLD
120
        register(Constants.TldDtdResourcePath_11,
121
                 Constants.TldDtdPublicId_11,
122
                 schemaResolver);
123
124
        register(Constants.TldDtdResourcePath_12,
125
                 Constants.TldDtdPublicId_12,
126
                 schemaResolver);
127
128
        register(Constants.TldSchemaResourcePath_20,
129
                 Constants.TldSchemaPublicId_20,
130
                 schemaResolver);
131
132
        register(Constants.TldSchemaResourcePath_21,
133
                Constants.TldSchemaPublicId_21,
134
                schemaResolver);
135
136
        // web.xml
137
        register(Constants.WebDtdResourcePath_22,
138
                 Constants.WebDtdPublicId_22,
139
                 schemaResolver);
140
141
        register(Constants.WebDtdResourcePath_23,
142
                 Constants.WebDtdPublicId_23,
143
                 schemaResolver);
144
145
        register(Constants.WebSchemaResourcePath_24,
146
                 Constants.WebSchemaPublicId_24,
147
                 schemaResolver);
148
149
        register(Constants.WebSchemaResourcePath_25,
150
                Constants.WebSchemaPublicId_25,
151
                schemaResolver);
152
153
        register(Constants.WebSchemaResourcePath_30,
154
                Constants.WebSchemaPublicId_30,
155
                schemaResolver);
156
157
        register(Constants.WebCommonSchemaResourcePath_30,
158
                Constants.WebCommonSchemaPublicId_30,
159
                schemaResolver);
160
161
        register(Constants.WebFragmentSchemaResourcePath_30,
162
                Constants.WebFragmentSchemaPublicId_30,
163
                schemaResolver);
164
165
        register(Constants.WebSchemaResourcePath_31,
166
                Constants.WebSchemaPublicId_31,
167
                schemaResolver);
168
169
        register(Constants.WebCommonSchemaResourcePath_31,
170
                Constants.WebCommonSchemaPublicId_31,
171
                schemaResolver);
172
173
        register(Constants.WebFragmentSchemaResourcePath_31,
174
                Constants.WebFragmentSchemaPublicId_31,
175
                schemaResolver);
176
177
        // Web Service
178
        register(Constants.J2eeWebServiceSchemaResourcePath_11,
179
                 Constants.J2eeWebServiceSchemaPublicId_11,
180
                 schemaResolver);
181
182
        register(Constants.J2eeWebServiceClientSchemaResourcePath_11,
183
                 Constants.J2eeWebServiceClientSchemaPublicId_11,
184
                 schemaResolver);
185
186
        register(Constants.JavaeeWebServiceSchemaResourcePath_12,
187
                Constants.JavaeeWebServiceSchemaPublicId_12,
188
                schemaResolver);
189
190
        register(Constants.JavaeeWebServiceClientSchemaResourcePath_12,
191
                Constants.JavaeeWebServiceClientSchemaPublicId_12,
192
                schemaResolver);
193
194
        register(Constants.JavaeeWebServiceSchemaResourcePath_13,
195
                Constants.JavaeeWebServiceSchemaPublicId_13,
196
                schemaResolver);
197
198
        register(Constants.JavaeeWebServiceClientSchemaResourcePath_13,
199
                Constants.JavaeeWebServiceClientSchemaPublicId_13,
200
                schemaResolver);
201
202
        register(Constants.JavaeeWebServiceSchemaResourcePath_14,
203
                Constants.JavaeeWebServiceSchemaPublicId_14,
204
                schemaResolver);
205
206
        register(Constants.JavaeeWebServiceClientSchemaResourcePath_14,
207
                Constants.JavaeeWebServiceClientSchemaPublicId_14,
208
                schemaResolver);
209
    }
210
211
212
    /**
213
     * Load the resource and add it to the resolver.
214
     */
215
    protected static void register(String resourceURL, String resourcePublicId,
216
            SchemaResolver schemaResolver){
217
        URL url = DigesterFactory.class.getResource(resourceURL);
218
219
        if(url == null) {
220
            log.warn("Could not get url for " + resourceURL);
221
        } else {
222
            schemaResolver.register(resourcePublicId , url.toString() );
223
        }
224
    }
225
}
101
}
(-)java/org/apache/catalina/util/SchemaResolver.java (-128 lines)
Lines 1-128 Link Here
1
/*
2
 * Licensed to the Apache Software Foundation (ASF) under one or more
3
 * contributor license agreements.  See the NOTICE file distributed with
4
 * this work for additional information regarding copyright ownership.
5
 * The ASF licenses this file to You under the Apache License, Version 2.0
6
 * (the "License"); you may not use this file except in compliance with
7
 * the License.  You may obtain a copy of the License at
8
 *
9
 *      http://www.apache.org/licenses/LICENSE-2.0
10
 *
11
 * Unless required by applicable law or agreed to in writing, software
12
 * distributed under the License is distributed on an "AS IS" BASIS,
13
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
 * See the License for the specific language governing permissions and
15
 * limitations under the License.
16
 */
17
package org.apache.catalina.util;
18
19
20
import java.util.HashMap;
21
import java.util.Map;
22
23
import org.apache.tomcat.util.digester.Digester;
24
import org.xml.sax.EntityResolver;
25
import org.xml.sax.InputSource;
26
import org.xml.sax.SAXException;
27
28
/**
29
 * This class implements a local SAX's <code>EntityResolver</code>. All
30
 * DTDs and schemas used to validate the web.xml file will re-directed
31
 * to a local file stored in the servlet-api.jar and jsp-api.jar.
32
 *
33
 * @author Jean-Francois Arcand
34
 */
35
public class SchemaResolver implements EntityResolver {
36
37
    /**
38
     * The digester instance for which this class is the entity resolver.
39
     */
40
    protected final Digester digester;
41
42
43
    /**
44
     * The URLs of dtds and schemas that have been registered, keyed by the
45
     * public identifier that corresponds.
46
     */
47
    protected final Map<String,String> entityValidator = new HashMap<>();
48
49
50
    /**
51
     * Extension to make the difference between DTD and Schema.
52
     */
53
    protected final String schemaExtension = "xsd";
54
55
56
    /**
57
     * Create a new <code>EntityResolver</code> that will redirect
58
     * all remote dtds and schema to a local destination.
59
     * @param digester The digester instance.
60
     */
61
    public SchemaResolver(Digester digester) {
62
        this.digester = digester;
63
    }
64
65
66
    /**
67
     * Register the specified DTD/Schema URL for the specified public
68
     * identifier. This must be called before the first call to
69
     * <code>parse()</code>.
70
     *
71
     * When adding a schema file (*.xsd), only the name of the file
72
     * will get added. If two schemas with the same name are added,
73
     * only the last one will be stored.
74
     *
75
     * @param publicId Public identifier of the DTD to be resolved
76
     * @param entityURL The URL to use for reading this DTD
77
     */
78
     public void register(String publicId, String entityURL) {
79
         String key = publicId;
80
         if (publicId.indexOf(schemaExtension) != -1)
81
             key = publicId.substring(publicId.lastIndexOf('/')+1);
82
         entityValidator.put(key, entityURL);
83
     }
84
85
86
    /**
87
     * Resolve the requested external entity.
88
     *
89
     * @param publicId The public identifier of the entity being referenced
90
     * @param systemId The system identifier of the entity being referenced
91
     *
92
     * @exception SAXException if a parsing exception occurs
93
     *
94
     */
95
    @Override
96
    public InputSource resolveEntity(String publicId, String systemId)
97
        throws SAXException {
98
99
        if (publicId != null) {
100
            digester.setPublicId(publicId);
101
        }
102
103
        // Has this system identifier been registered?
104
        String entityURL = null;
105
        if (publicId != null) {
106
            entityURL = entityValidator.get(publicId);
107
        }
108
109
        // Redirect the schema location to a local destination
110
        String key = null;
111
        if (entityURL == null && systemId != null) {
112
            key = systemId.substring(systemId.lastIndexOf('/')+1);
113
            entityURL = entityValidator.get(key);
114
        }
115
116
        if (entityURL == null) {
117
           return (null);
118
        }
119
120
        try {
121
            return (new InputSource(entityURL));
122
        } catch (Exception e) {
123
            throw new SAXException(e);
124
        }
125
126
    }
127
128
}
(-)java/org/apache/jasper/Constants.java (-6 / +8 lines)
Lines 22-28 Link Here
22
import java.util.Collections;
22
import java.util.Collections;
23
import java.util.List;
23
import java.util.List;
24
24
25
import org.apache.tomcat.XmlIdentifiers;
25
26
27
26
/**
28
/**
27
 * Some constants and other global data that are used by the compiler and the runtime.
29
 * Some constants and other global data that are used by the compiler and the runtime.
28
 *
30
 *
Lines 125-148 Link Here
125
     * of the DTDs for tag library descriptors.
127
     * of the DTDs for tag library descriptors.
126
     */
128
     */
127
    private static final String TAGLIB_DTD_PUBLIC_ID_11 =
129
    private static final String TAGLIB_DTD_PUBLIC_ID_11 =
128
        "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.1//EN";
130
        XmlIdentifiers.TLD_11_DTD;
129
    private static final String TAGLIB_DTD_RESOURCE_PATH_11 =
131
    private static final String TAGLIB_DTD_RESOURCE_PATH_11 =
130
        "/javax/servlet/jsp/resources/web-jsptaglibrary_1_1.dtd";
132
        "/javax/servlet/resources/web-jsptaglibrary_1_1.dtd";
131
    private static final String TAGLIB_DTD_PUBLIC_ID_12 =
133
    private static final String TAGLIB_DTD_PUBLIC_ID_12 =
132
        "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN";
134
        XmlIdentifiers.TLD_12_DTD;
133
    private static final String TAGLIB_DTD_RESOURCE_PATH_12 =
135
    private static final String TAGLIB_DTD_RESOURCE_PATH_12 =
134
        "/javax/servlet/jsp/resources/web-jsptaglibrary_1_2.dtd";
136
        "/javax/servlet/resources/web-jsptaglibrary_1_2.dtd";
135
137
136
    /**
138
    /**
137
     * Public Id and the Resource path (of the cached copy)
139
     * Public Id and the Resource path (of the cached copy)
138
     * of the DTDs for web application deployment descriptors
140
     * of the DTDs for web application deployment descriptors
139
     */
141
     */
140
    private static final String WEBAPP_DTD_PUBLIC_ID_22 =
142
    private static final String WEBAPP_DTD_PUBLIC_ID_22 =
141
        "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN";
143
        XmlIdentifiers.WEB_22_DTD;
142
    private static final String WEBAPP_DTD_RESOURCE_PATH_22 =
144
    private static final String WEBAPP_DTD_RESOURCE_PATH_22 =
143
        "/javax/servlet/resources/web-app_2_2.dtd";
145
        "/javax/servlet/resources/web-app_2_2.dtd";
144
    private static final String WEBAPP_DTD_PUBLIC_ID_23 =
146
    private static final String WEBAPP_DTD_PUBLIC_ID_23 =
145
        "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN";
147
        XmlIdentifiers.WEB_23_DTD;
146
    private static final String WEBAPP_DTD_RESOURCE_PATH_23 =
148
    private static final String WEBAPP_DTD_RESOURCE_PATH_23 =
147
        "/javax/servlet/resources/web-app_2_3.dtd";
149
        "/javax/servlet/resources/web-app_2_3.dtd";
148
150
(-)java/org/apache/tomcat/XmlIdentifiers.java (+56 lines)
Line 0 Link Here
1
/*
2
 * Licensed to the Apache Software Foundation (ASF) under one or more
3
 * contributor license agreements.  See the NOTICE file distributed with
4
 * this work for additional information regarding copyright ownership.
5
 * The ASF licenses this file to You under the Apache License, Version 2.0
6
 * (the "License"); you may not use this file except in compliance with
7
 * the License.  You may obtain a copy of the License at
8
 *
9
 *      http://www.apache.org/licenses/LICENSE-2.0
10
 *
11
 * Unless required by applicable law or agreed to in writing, software
12
 * distributed under the License is distributed on an "AS IS" BASIS,
13
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
 * See the License for the specific language governing permissions and
15
 * limitations under the License.
16
 */
17
package org.apache.tomcat;
18
19
/**
20
 * Defines constants for well-known Public and System identifiers.
21
 */
22
public final class XmlIdentifiers {
23
24
    // from W3C
25
    public static final String XML_2001_XSD = "http://www.w3.org/2001/xml.xsd";
26
    public static final String DATATYPES_DTD = "datatypes";
27
    public static final String XSD_10_DTD = "-//W3C//DTD XMLSCHEMA 200102//EN";
28
29
    // from J2EE 1.2
30
    public static final String WEB_22_DTD = "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN";
31
    public static final String TLD_11_DTD = "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.1//EN";
32
33
    // from J2EE 1.3
34
    public static final String WEB_23_DTD = "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN";
35
    public static final String TLD_12_DTD = "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN";
36
37
    // from J2EE 1.4
38
    public static final String WEB_24_XSD = "http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd";
39
    public static final String TLD_20_XSD = "http://java.sun.com/xml/ns/j2ee/web-jsptaglibrary_2_0.xsd";
40
41
    // from JavaEE 5
42
    public static final String WEB_25_XSD = "http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd";
43
    public static final String TLD_21_XSD = "http://java.sun.com/xml/ns/javaee/web-jsptaglibrary_2_1.xsd";
44
45
    // from JavaEE 6
46
    public static final String WEB_30_XSD = "http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd";
47
    public static final String WEB_FRAGMENT_30_XSD = "http://java.sun.com/xml/ns/javaee/web-fragment_3_0.xsd";
48
49
    // from JavaEE 7
50
    public static final String WEB_31_XSD = "http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd";
51
    public static final String WEB_FRAGMENT_31_XSD = "http://xmlns.jcp.org/xml/ns/javaee/web-fragment_3_1.xsd";
52
53
    private XmlIdentifiers() {
54
    }
55
}
56
native
(-)java/org/apache/tomcat/util/digester/Digester.java (-17 / +28 lines)
Lines 21-26 Link Here
21
import java.io.IOException;
21
import java.io.IOException;
22
import java.io.InputStream;
22
import java.io.InputStream;
23
import java.lang.reflect.InvocationTargetException;
23
import java.lang.reflect.InvocationTargetException;
24
import java.net.URI;
25
import java.net.URISyntaxException;
24
import java.util.EmptyStackException;
26
import java.util.EmptyStackException;
25
import java.util.HashMap;
27
import java.util.HashMap;
26
import java.util.Iterator;
28
import java.util.Iterator;
Lines 45-52 Link Here
45
import org.xml.sax.SAXNotSupportedException;
47
import org.xml.sax.SAXNotSupportedException;
46
import org.xml.sax.SAXParseException;
48
import org.xml.sax.SAXParseException;
47
import org.xml.sax.XMLReader;
49
import org.xml.sax.XMLReader;
50
import org.xml.sax.ext.DefaultHandler2;
48
import org.xml.sax.helpers.AttributesImpl;
51
import org.xml.sax.helpers.AttributesImpl;
49
import org.xml.sax.helpers.DefaultHandler;
50
52
51
53
52
/**
54
/**
Lines 68-74 Link Here
68
 * the support of XML schema. You need Xerces 2.1/2.3 and up to make
70
 * the support of XML schema. You need Xerces 2.1/2.3 and up to make
69
 * this class working with XML schema</p>
71
 * this class working with XML schema</p>
70
 */
72
 */
71
public class Digester extends DefaultHandler {
73
public class Digester extends DefaultHandler2 {
72
74
73
75
74
    // ---------------------------------------------------------- Static Fields
76
    // ---------------------------------------------------------- Static Fields
Lines 791-796 Link Here
791
            reader.setEntityResolver(entityResolver);
793
            reader.setEntityResolver(entityResolver);
792
        }
794
        }
793
795
796
        reader.setProperty("http://xml.org/sax/properties/lexical-handler", this);
797
794
        reader.setErrorHandler(this);
798
        reader.setErrorHandler(this);
795
        return reader;
799
        return reader;
796
    }
800
    }
Lines 1275-1300 Link Here
1275
        return entityResolver;
1279
        return entityResolver;
1276
    }
1280
    }
1277
1281
1278
    /**
1279
     * Resolve the requested external entity.
1280
     *
1281
     * @param publicId The public identifier of the entity being referenced
1282
     * @param systemId The system identifier of the entity being referenced
1283
     *
1284
     * @exception SAXException if a parsing exception occurs
1285
     *
1286
     */
1287
    @Override
1282
    @Override
1288
    public InputSource resolveEntity(String publicId, String systemId)
1283
    public InputSource resolveEntity(String name, String publicId, String baseURI, String systemId)
1289
            throws SAXException {
1284
            throws SAXException, IOException {
1290
1285
1291
        if (saxLog.isDebugEnabled()) {
1286
        if (saxLog.isDebugEnabled()) {
1292
            saxLog.debug("resolveEntity('" + publicId + "', '" + systemId + "')");
1287
            saxLog.debug("resolveEntity('" + publicId + "', '" + systemId + "', '" + baseURI + "')");
1293
        }
1288
        }
1294
1289
1295
        if (publicId != null)
1296
            this.publicId = publicId;
1297
1298
        // Has this system identifier been registered?
1290
        // Has this system identifier been registered?
1299
        String entityURL = null;
1291
        String entityURL = null;
1300
        if (publicId != null) {
1292
        if (publicId != null) {
Lines 1315-1320 Link Here
1315
                    log.debug(" Trying to resolve using system ID '" + systemId + "'");
1307
                    log.debug(" Trying to resolve using system ID '" + systemId + "'");
1316
                }
1308
                }
1317
                entityURL = systemId;
1309
                entityURL = systemId;
1310
                // resolve systemId against baseURI if it is not absolute
1311
                if (baseURI != null) {
1312
                    try {
1313
                        URI uri = new URI(systemId);
1314
                        if (!uri.isAbsolute()) {
1315
                            entityURL = new URI(baseURI).resolve(uri).toString();
1316
                        }
1317
                    } catch (URISyntaxException e) {
1318
                        if (log.isDebugEnabled()) {
1319
                            log.debug("Invalid URI '" + baseURI + "' or '" + systemId + "'");
1320
                        }
1321
                    }
1322
                }
1318
            }
1323
            }
1319
        }
1324
        }
1320
1325
Lines 1330-1336 Link Here
1330
        }
1335
        }
1331
    }
1336
    }
1332
1337
1338
    // ----------------------------------------------- LexicalHandler Methods
1333
1339
1340
    @Override
1341
    public void startDTD(String name, String publicId, String systemId) throws SAXException {
1342
        setPublicId(publicId);
1343
    }
1344
1334
    // ------------------------------------------------- ErrorHandler Methods
1345
    // ------------------------------------------------- ErrorHandler Methods
1335
1346
1336
1347
(-)java/org/apache/tomcat/util/res/LocalResolver.java (+107 lines)
Line 0 Link Here
1
/*
2
 * Licensed to the Apache Software Foundation (ASF) under one or more
3
 * contributor license agreements.  See the NOTICE file distributed with
4
 * this work for additional information regarding copyright ownership.
5
 * The ASF licenses this file to You under the Apache License, Version 2.0
6
 * (the "License"); you may not use this file except in compliance with
7
 * the License.  You may obtain a copy of the License at
8
 *
9
 *      http://www.apache.org/licenses/LICENSE-2.0
10
 *
11
 * Unless required by applicable law or agreed to in writing, software
12
 * distributed under the License is distributed on an "AS IS" BASIS,
13
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
 * See the License for the specific language governing permissions and
15
 * limitations under the License.
16
 */
17
package org.apache.tomcat.util.res;
18
19
import java.io.IOException;
20
import java.net.URI;
21
import java.net.URISyntaxException;
22
import java.util.Map;
23
24
import org.xml.sax.InputSource;
25
import org.xml.sax.SAXException;
26
import org.xml.sax.ext.EntityResolver2;
27
28
/**
29
 * A resolver for locally cached XML resources.
30
 */
31
public class LocalResolver implements EntityResolver2 {
32
    private final Map<String, String> publicIds;
33
    private final Map<String, String> systemIds;
34
35
    /**
36
     * Constructor providing mappings of public and system identifiers to local resources.
37
     *
38
     * @param publicIds mapping of public identifiers to local resources
39
     * @param systemIds mapping of system identifiers to local resources
40
     */
41
    public LocalResolver(Map<String, String> publicIds, Map<String, String> systemIds) {
42
        this.publicIds = publicIds;
43
        this.systemIds = systemIds;
44
    }
45
46
    @Override
47
    public InputSource resolveEntity(String publicId, String systemId) throws SAXException, IOException {
48
        return resolveEntity(null, publicId, null, systemId);
49
    }
50
51
    @Override
52
    public InputSource resolveEntity(String name, String publicId, String baseURI, String systemId)
53
            throws SAXException, IOException {
54
55
        String resolved = resolve(publicId, systemId, baseURI);
56
        if (resolved == null) {
57
            return null;
58
        }
59
60
        InputSource is = new InputSource(resolved);
61
        is.setPublicId(publicId);
62
        return is;
63
    }
64
65
    @Override
66
    public InputSource getExternalSubset(String name, String baseURI) throws SAXException, IOException {
67
        return null;
68
    }
69
70
    private String resolve(String publicId, String systemId, String baseURI) {
71
        // try resolving using the publicId
72
        String resolved = publicIds.get(publicId);
73
        if (resolved != null) {
74
            return resolved;
75
        }
76
77
        // try resolving using the systemId
78
        if (systemId == null) {
79
            return null;
80
        }
81
82
        systemId = resolve(baseURI, systemId);
83
        resolved = systemIds.get(systemId);
84
        if (resolved != null) {
85
            return resolved;
86
        }
87
88
        // fall back to the supplied systemId
89
        return systemId;
90
    }
91
92
    private static String resolve(String baseURI, String systemId) {
93
        try {
94
            if (baseURI == null) {
95
                return systemId;
96
            }
97
            URI systemUri = new URI(systemId);
98
            if (systemUri.isAbsolute()) {
99
                return systemId;
100
            }
101
            return new URI(baseURI).resolve(systemUri).toString();
102
        } catch (URISyntaxException e) {
103
            return systemId;
104
        }
105
    }
106
}
107
native
(-)test/javax/servlet/TestSchemaValidation.java (+89 lines)
Line 0 Link Here
1
/*
2
 * Licensed to the Apache Software Foundation (ASF) under one or more
3
 * contributor license agreements.  See the NOTICE file distributed with
4
 * this work for additional information regarding copyright ownership.
5
 * The ASF licenses this file to You under the Apache License, Version 2.0
6
 * (the "License"); you may not use this file except in compliance with
7
 * the License.  You may obtain a copy of the License at
8
 *
9
 *      http://www.apache.org/licenses/LICENSE-2.0
10
 *
11
 * Unless required by applicable law or agreed to in writing, software
12
 * distributed under the License is distributed on an "AS IS" BASIS,
13
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
 * See the License for the specific language governing permissions and
15
 * limitations under the License.
16
 */
17
package javax.servlet;
18
19
import java.io.File;
20
21
import org.apache.catalina.deploy.WebXml;
22
import org.apache.catalina.startup.DigesterFactory;
23
import org.apache.catalina.startup.WebRuleSet;
24
import org.apache.tomcat.XmlIdentifiers;
25
import org.apache.tomcat.util.digester.Digester;
26
import org.junit.Assert;
27
import org.junit.Test;
28
29
public class TestSchemaValidation {
30
31
    @Test
32
    public void testWebapp() throws Exception {
33
        Digester digester = DigesterFactory.newDigester(true, true, new WebRuleSet(false));
34
        digester.push(new WebXml());
35
        WebXml desc = (WebXml) digester.parse(new File("test/webapp/WEB-INF/web.xml"));
36
        Assert.assertEquals("3.1", desc.getVersion());
37
    }
38
39
    @Test
40
    public void testWebapp_2_2() throws Exception {
41
        Digester digester = DigesterFactory.newDigester(true, true, new WebRuleSet(false));
42
        digester.push(new WebXml());
43
        WebXml desc = (WebXml) digester.parse(new File("test/webapp-2.2/WEB-INF/web.xml"));
44
        Assert.assertEquals("2.2", desc.getVersion());
45
        Assert.assertEquals(XmlIdentifiers.WEB_22_DTD, desc.getPublicId());
46
    }
47
48
    @Test
49
    public void testWebapp_2_3() throws Exception {
50
        Digester digester = DigesterFactory.newDigester(true, true, new WebRuleSet(false));
51
        digester.push(new WebXml());
52
        WebXml desc = (WebXml) digester.parse(new File("test/webapp-2.3/WEB-INF/web.xml"));
53
        Assert.assertEquals("2.3", desc.getVersion());
54
        Assert.assertEquals(XmlIdentifiers.WEB_23_DTD, desc.getPublicId());
55
    }
56
57
    @Test
58
    public void testWebapp_2_4() throws Exception {
59
        Digester digester = DigesterFactory.newDigester(true, true, new WebRuleSet(false));
60
        digester.push(new WebXml());
61
        WebXml desc = (WebXml) digester.parse(new File("test/webapp-2.4/WEB-INF/web.xml"));
62
        Assert.assertEquals("2.4", desc.getVersion());
63
    }
64
65
    @Test
66
    public void testWebapp_2_5() throws Exception {
67
        Digester digester = DigesterFactory.newDigester(true, true, new WebRuleSet(false));
68
        digester.push(new WebXml());
69
        WebXml desc = (WebXml) digester.parse(new File("test/webapp-2.5/WEB-INF/web.xml"));
70
        Assert.assertEquals("2.5", desc.getVersion());
71
    }
72
73
    @Test
74
    public void testWebapp_3_0() throws Exception {
75
        Digester digester = DigesterFactory.newDigester(true, true, new WebRuleSet(false));
76
        digester.push(new WebXml());
77
        WebXml desc = (WebXml) digester.parse(new File("test/webapp-3.0/WEB-INF/web.xml"));
78
        Assert.assertEquals("3.0", desc.getVersion());
79
    }
80
81
    @Test
82
    public void testWebapp_3_1() throws Exception {
83
        Digester digester = DigesterFactory.newDigester(true, true, new WebRuleSet(false));
84
        digester.push(new WebXml());
85
        WebXml desc = (WebXml) digester.parse(new File("test/webapp-3.1/WEB-INF/web.xml"));
86
        Assert.assertEquals("3.1", desc.getVersion());
87
    }
88
}
89
native
(-)test/org/apache/catalina/deploy/TestWebXml.java (-43 / +15 lines)
Lines 21-26 Link Here
21
import java.util.Map;
21
import java.util.Map;
22
import java.util.Set;
22
import java.util.Set;
23
23
24
import org.apache.tomcat.XmlIdentifiers;
24
import org.junit.Assert;
25
import org.junit.Assert;
25
import org.junit.Test;
26
import org.junit.Test;
26
27
Lines 43-80 Link Here
43
        Assert.assertEquals(2, webxml.getMajorVersion());
44
        Assert.assertEquals(2, webxml.getMajorVersion());
44
        Assert.assertEquals(5, webxml.getMinorVersion());
45
        Assert.assertEquals(5, webxml.getMinorVersion());
45
46
46
        // Reset
47
        // unknown input should be ignored
47
        webxml.setVersion("0.0");
48
        webxml.setVersion("0.0");
48
        Assert.assertEquals(0, webxml.getMajorVersion());
49
        Assert.assertEquals(2, webxml.getMajorVersion());
49
        Assert.assertEquals(0, webxml.getMinorVersion());
50
        Assert.assertEquals(5, webxml.getMinorVersion());
50
51
51
        // null input should be ignored
52
        // null input should be ignored
52
        webxml.setVersion(null);
53
        webxml.setVersion(null);
53
        Assert.assertEquals(0, webxml.getMajorVersion());
54
        Assert.assertEquals(2, webxml.getMajorVersion());
54
        Assert.assertEquals(0, webxml.getMinorVersion());
55
56
        // major only
57
        webxml.setVersion("3");
58
        Assert.assertEquals(3, webxml.getMajorVersion());
59
        Assert.assertEquals(0, webxml.getMinorVersion());
60
61
        // no minor digit
62
        webxml.setVersion("0.0");   // reset
63
        webxml.setVersion("3.");
64
        Assert.assertEquals(3, webxml.getMajorVersion());
65
        Assert.assertEquals(0, webxml.getMinorVersion());
66
67
        // minor only
68
        webxml.setVersion("0.0");   // reset
69
        webxml.setVersion(".5");
70
        Assert.assertEquals(0, webxml.getMajorVersion());
71
        Assert.assertEquals(5, webxml.getMinorVersion());
55
        Assert.assertEquals(5, webxml.getMinorVersion());
72
73
        // leading & training zeros
74
        webxml.setVersion("0.0");   // reset
75
        webxml.setVersion("002.500");
76
        Assert.assertEquals(2, webxml.getMajorVersion());
77
        Assert.assertEquals(500, webxml.getMinorVersion());
78
    }
56
    }
79
57
80
    @Test
58
    @Test
Lines 82-89 Link Here
82
60
83
        WebXml webxml = new WebXml();
61
        WebXml webxml = new WebXml();
84
62
85
        webxml.setPublicId(
63
        webxml.setPublicId(XmlIdentifiers.WEB_22_DTD);
86
                org.apache.catalina.startup.Constants.WebDtdPublicId_22);
87
        Assert.assertEquals(2, webxml.getMajorVersion());
64
        Assert.assertEquals(2, webxml.getMajorVersion());
88
        Assert.assertEquals(2, webxml.getMinorVersion());
65
        Assert.assertEquals(2, webxml.getMinorVersion());
89
        Assert.assertEquals("2.2", webxml.getVersion());
66
        Assert.assertEquals("2.2", webxml.getVersion());
Lines 94-149 Link Here
94
71
95
        WebXml webxml = new WebXml();
72
        WebXml webxml = new WebXml();
96
73
97
        webxml.setPublicId(
74
        webxml.setPublicId(XmlIdentifiers.WEB_23_DTD);
98
                org.apache.catalina.startup.Constants.WebDtdPublicId_23);
99
        Assert.assertEquals(2, webxml.getMajorVersion());
75
        Assert.assertEquals(2, webxml.getMajorVersion());
100
        Assert.assertEquals(3, webxml.getMinorVersion());
76
        Assert.assertEquals(3, webxml.getMinorVersion());
101
        Assert.assertEquals("2.3", webxml.getVersion());
77
        Assert.assertEquals("2.3", webxml.getVersion());
102
    }
78
    }
103
79
104
    @Test
80
    @Test
105
    public void testParsePublicIdVersion24() {
81
    public void testParseVersion24() {
106
82
107
        WebXml webxml = new WebXml();
83
        WebXml webxml = new WebXml();
108
84
109
        webxml.setPublicId(
85
        webxml.setVersion("2.4");
110
                org.apache.catalina.startup.Constants.WebSchemaPublicId_24);
111
        Assert.assertEquals(2, webxml.getMajorVersion());
86
        Assert.assertEquals(2, webxml.getMajorVersion());
112
        Assert.assertEquals(4, webxml.getMinorVersion());
87
        Assert.assertEquals(4, webxml.getMinorVersion());
113
        Assert.assertEquals("2.4", webxml.getVersion());
88
        Assert.assertEquals("2.4", webxml.getVersion());
114
    }
89
    }
115
90
116
    @Test
91
    @Test
117
    public void testParsePublicIdVersion25() {
92
    public void testParseVersion25() {
118
93
119
        WebXml webxml = new WebXml();
94
        WebXml webxml = new WebXml();
120
95
121
        webxml.setPublicId(
96
        webxml.setVersion("2.5");
122
                org.apache.catalina.startup.Constants.WebSchemaPublicId_25);
123
        Assert.assertEquals(2, webxml.getMajorVersion());
97
        Assert.assertEquals(2, webxml.getMajorVersion());
124
        Assert.assertEquals(5, webxml.getMinorVersion());
98
        Assert.assertEquals(5, webxml.getMinorVersion());
125
        Assert.assertEquals("2.5", webxml.getVersion());
99
        Assert.assertEquals("2.5", webxml.getVersion());
126
    }
100
    }
127
101
128
    @Test
102
    @Test
129
    public void testParsePublicIdVersion30() {
103
    public void testParseVersion30() {
130
104
131
        WebXml webxml = new WebXml();
105
        WebXml webxml = new WebXml();
132
106
133
        webxml.setPublicId(
107
        webxml.setVersion("3.0");
134
                org.apache.catalina.startup.Constants.WebSchemaPublicId_30);
135
        Assert.assertEquals(3, webxml.getMajorVersion());
108
        Assert.assertEquals(3, webxml.getMajorVersion());
136
        Assert.assertEquals(0, webxml.getMinorVersion());
109
        Assert.assertEquals(0, webxml.getMinorVersion());
137
        Assert.assertEquals("3.0", webxml.getVersion());
110
        Assert.assertEquals("3.0", webxml.getVersion());
138
    }
111
    }
139
112
140
    @Test
113
    @Test
141
    public void testParsePublicIdVersion31() {
114
    public void testParseVersion31() {
142
115
143
        WebXml webxml = new WebXml();
116
        WebXml webxml = new WebXml();
144
117
145
        webxml.setPublicId(
118
        webxml.setVersion("3.1");
146
                org.apache.catalina.startup.Constants.WebSchemaPublicId_31);
147
        Assert.assertEquals(3, webxml.getMajorVersion());
119
        Assert.assertEquals(3, webxml.getMajorVersion());
148
        Assert.assertEquals(1, webxml.getMinorVersion());
120
        Assert.assertEquals(1, webxml.getMinorVersion());
149
        Assert.assertEquals("3.1", webxml.getVersion());
121
        Assert.assertEquals("3.1", webxml.getVersion());
(-)test/org/apache/jasper/compiler/TestJspConfig.java (+20 lines)
Lines 30-35 Link Here
30
public class TestJspConfig extends TomcatBaseTest {
30
public class TestJspConfig extends TomcatBaseTest {
31
31
32
    @Test
32
    @Test
33
    public void testServlet22NoEL() throws Exception {
34
        Tomcat tomcat = getTomcatInstance();
35
36
        File appDir =
37
            new File("test/webapp-2.2");
38
        // app dir is relative to server home
39
        tomcat.addWebapp(null, "/test", appDir.getAbsolutePath());
40
41
        tomcat.start();
42
43
        ByteChunk res = getUrl("http://localhost:" + getPort() +
44
                "/test/el-as-literal.jsp");
45
46
        String result = res.toString();
47
48
        assertTrue(result.indexOf("<p>00-${'hello world'}</p>") > 0);
49
        assertTrue(result.indexOf("<p>01-#{'hello world'}</p>") > 0);
50
    }
51
52
    @Test
33
    public void testServlet23NoEL() throws Exception {
53
    public void testServlet23NoEL() throws Exception {
34
        Tomcat tomcat = getTomcatInstance();
54
        Tomcat tomcat = getTomcatInstance();
35
55
(-)test/org/apache/jasper/compiler/TestValidator.java (+25 lines)
Lines 53-58 Link Here
53
    }
53
    }
54
54
55
    @Test
55
    @Test
56
    public void testTldVersions22() throws Exception {
57
        Tomcat tomcat = getTomcatInstance();
58
59
        File appDir =
60
            new File("test/webapp-2.2");
61
        // app dir is relative to server home
62
        tomcat.addWebapp(null, "/test", appDir.getAbsolutePath());
63
64
        tomcat.start();
65
66
        ByteChunk res = getUrl("http://localhost:" + getPort() +
67
                "/test/tld-versions.jsp");
68
69
        String result = res.toString();
70
71
        assertTrue(result.indexOf("<p>${'00-hello world'}</p>") > 0);
72
        assertTrue(result.indexOf("<p>#{'01-hello world'}</p>") > 0);
73
        assertTrue(result.indexOf("<p>${'02-hello world'}</p>") > 0);
74
        assertTrue(result.indexOf("<p>#{'03-hello world'}</p>") > 0);
75
        assertTrue(result.indexOf("<p>${'04-hello world'}</p>") > 0);
76
        assertTrue(result.indexOf("<p>#{'05-hello world'}</p>") > 0);
77
        assertTrue(result.indexOf("<p>${'06-hello world'}</p>") > 0);
78
    }
79
80
    @Test
56
    public void testTldVersions23() throws Exception {
81
    public void testTldVersions23() throws Exception {
57
        Tomcat tomcat = getTomcatInstance();
82
        Tomcat tomcat = getTomcatInstance();
58
83
(-)test/webapp-2.2/WEB-INF/tags12.tld (-1 / +1 lines)
Lines 25-31 Link Here
25
25
26
  <tag>
26
  <tag>
27
    <name>Echo</name>
27
    <name>Echo</name>
28
    <tagclass>org.apache.jasper.compiler.TestValidator$Echo</tagclass>
28
    <tag-class>org.apache.jasper.compiler.TestValidator$Echo</tag-class>
29
    <body-content>empty</body-content>
29
    <body-content>empty</body-content>
30
    <attribute>
30
    <attribute>
31
      <name>echo</name>
31
      <name>echo</name>
(-)test/webapp-2.2/WEB-INF/tags20.tld (-4 / +4 lines)
Lines 14-23 Link Here
14
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
  See the License for the specific language governing permissions and
15
  See the License for the specific language governing permissions and
16
  limitations under the License.
16
  limitations under the License.
17
--><taglib xmlns="http://java.sun.com/xml/ns/javaee"
17
--><taglib xmlns="http://java.sun.com/xml/ns/j2ee"
18
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
18
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
19
      xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
19
      xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
20
      http://java.sun.com/xml/ns/javaee/web-jsptaglibrary_2_0.xsd"
20
      http://java.sun.com/xml/ns/j2ee/web-jsptaglibrary_2_0.xsd"
21
      version="2.0">
21
      version="2.0">
22
  <tlib-version>1.0</tlib-version>
22
  <tlib-version>1.0</tlib-version>
23
  <short-name>Tags20</short-name>
23
  <short-name>Tags20</short-name>
Lines 25-31 Link Here
25
25
26
  <tag>
26
  <tag>
27
    <name>Echo</name>
27
    <name>Echo</name>
28
    <tagclass>org.apache.jasper.compiler.TestValidator$Echo</tagclass>
28
    <tag-class>org.apache.jasper.compiler.TestValidator$Echo</tag-class>
29
    <body-content>empty</body-content>
29
    <body-content>empty</body-content>
30
    <attribute>
30
    <attribute>
31
      <name>echo</name>
31
      <name>echo</name>
(-)test/webapp-2.2/WEB-INF/tags21.tld (-1 / +1 lines)
Lines 25-31 Link Here
25
25
26
  <tag>
26
  <tag>
27
    <name>Echo</name>
27
    <name>Echo</name>
28
    <tagclass>org.apache.jasper.compiler.TestValidator$Echo</tagclass>
28
    <tag-class>org.apache.jasper.compiler.TestValidator$Echo</tag-class>
29
    <body-content>empty</body-content>
29
    <body-content>empty</body-content>
30
    <attribute>
30
    <attribute>
31
      <name>echo</name>
31
      <name>echo</name>
(-)test/webapp-2.2/WEB-INF/web.xml (-5 / +5 lines)
Lines 16-30 Link Here
16
  limitations under the License.
16
  limitations under the License.
17
-->
17
-->
18
<!DOCTYPE web-app PUBLIC
18
<!DOCTYPE web-app PUBLIC
19
  "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
19
  "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
20
  "http://java.sun.com/dtd/web-app_2_3.dtd">
20
  "http://java.sun.com/dtd/web-app_2_2.dtd">
21
<web-app>
21
<web-app>
22
  <display-name>Tomcat Servlet 2.3 Tests</display-name>
22
  <display-name>Tomcat Servlet 2.2 Tests</display-name>
23
  <description>
23
  <description>
24
    Provides a web application used by the Tomcat unit tests to ensure that
24
    Provides a web application used by the Tomcat unit tests to ensure that
25
    Tomcat meets the requirements of the current JSP and Servlet specification
25
    Tomcat meets the requirements of the current JSP and Servlet specification
26
    for web applications that declare that they follow version 2.3 of the
26
    for web applications that declare that they follow version 2.2 of the
27
    Servlet specification and version 1.2 of the JSP specification. This
27
    Servlet specification and version 1.1 of the JSP specification. This
28
    typically means ensuring that features introduced in later versions of the
28
    typically means ensuring that features introduced in later versions of the
29
    specification do not change the behaviour of applications that declared an
29
    specification do not change the behaviour of applications that declared an
30
    earlier version of the specification.
30
    earlier version of the specification.

Return to bug 55166