1 /*
2 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3 *
4 * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
5 *
6 * Portions Copyright Apache Software Foundation.
7 *
8 * The contents of this file are subject to the terms of either the GNU
9 * General Public License Version 2 only ("GPL") or the Common Development
10 * and Distribution License("CDDL") (collectively, the "License"). You
11 * may not use this file except in compliance with the License. You can obtain
12 * a copy of the License at https://glassfish.dev.java.net/public/CDDL+GPL.html
13 * or glassfish/bootstrap/legal/LICENSE.txt. See the License for the specific
14 * language governing permissions and limitations under the License.
15 *
16 * When distributing the software, include this License Header Notice in each
17 * file and include the License file at glassfish/bootstrap/legal/LICENSE.txt.
18 * Sun designates this particular file as subject to the "Classpath" exception
19 * as provided by Sun in the GPL Version 2 section of the License file that
20 * accompanied this code. If applicable, add the following below the License
21 * Header, with the fields enclosed by brackets [] replaced by your own
22 * identifying information: "Portions Copyrighted [year]
23 * [name of copyright owner]"
24 *
25 * Contributor(s):
26 *
27 * If you wish your version of this file to be governed by only the CDDL or
28 * only the GPL Version 2, indicate your decision by adding "[Contributor]
29 * elects to include this software in this distribution under the [CDDL or GPL
30 * Version 2] license." If you don't indicate a single choice of license, a
31 * recipient has the option to distribute your version of this file under
32 * either the CDDL, the GPL Version 2 or to extend the choice of license to
33 * its licensees as provided above. However, if you add GPL Version 2 code
34 * and therefore, elected the GPL Version 2 license, then the option applies
35 * only if the new code is made subject to such option by the copyright
36 * holder.
37 */
38
39 package javax.servlet.jsp.tagext;
40
41 /**
42 * <p>This interface indicates to the container that a tag handler
43 * wishes to be provided with a
44 * compiler generated ID. </p>
45 *<p>The container sets the <code>jspId</code>
46 * attribute
47 * of the tag handler with an identification string, as part of tag
48 * property initialization. Each tag in a JSP page has a unique
49 * <code>jspId</code>, and a given tag in a JSP page always has the same
50 * <code>jspId</code>,
51 * even for multiple requests to the page.
52 * </p>
53 * <p>
54 * Tag handler instances that implement <code>JspIdConsumer</code>
55 * cannot be reused.
56 * </p>
57 * <p>
58 * Even though the <code>jspId</code> attribute is similar in concept to
59 * the <code>jsp:id</code>
60 * attribute of an XML view (see Section JSP.10.1.13 of the spec), they are
61 * not related.
62 * The <code>jsp:id</code> attribute is available only at translation time,
63 * and the <code>jspId</code>
64 * attribute is avalable only at request time.
65 * </p>
66 * <p>
67 * The JSP container must provide a value for <code>jspId</code> that
68 * conforms to the following rules:
69 * <ul>
70 * <li>It must start with a letter (as defined by the <code>Character.isLetter()</code>
71 * method) or underscore ('_').
72 * <li>Subsequent characters may be letters (as defined by the <code>Character.isLetter()</code>
73 * method), digits (as defined by the <code>Character.isDigit()</code> method), dashes ('-'),
74 * or underscores ('_')
75 * </ul>
76 * </p>
77 * <p>
78 * Note that the rules exclude colons ':' in a <code>jspId</code>,
79 * and that they are
80 * the same rules used for a component ID in JavaServer Faces.
81 * </p>
82 *
83 * @since JSP 2.1
84 */
85
86 public interface JspIdConsumer {
87
88 /**
89 * Called by the container generated code to set a value for the
90 * jspId attribute. An unique identification string, relative to
91 * this page, is generated at translation time.
92 */
93 public void setJspId(String id);
94 }