]> WPIA git - gigi.git/blob - lib/servlet-api/javax/servlet/annotation/WebServlet.java
Merge "upd: remove 'browser install'"
[gigi.git] / lib / servlet-api / javax / servlet / annotation / WebServlet.java
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.annotation;
18
19 import java.lang.annotation.Documented;
20 import java.lang.annotation.ElementType;
21 import java.lang.annotation.Retention;
22 import java.lang.annotation.RetentionPolicy;
23 import java.lang.annotation.Target;
24
25 /**
26  * This annotation is used to declare the configuration of an
27  * {@link javax.servlet.Servlet}. <br/>
28  *
29  * If the name attribute is not defined, the fully qualified name of the class
30  * is used.<br/>
31  * <br/>
32  *
33  * At least one URL pattern MUST be declared in either the {@code value} or
34  * {@code urlPattern} attribute of the annotation, but not both.<br/>
35  * <br/>
36  *
37  * The {@code value} attribute is recommended for use when the URL pattern is
38  * the only attribute being set, otherwise the {@code urlPattern} attribute
39  * should be used.<br />
40  * <br />
41  *
42  * The class on which this annotation is declared MUST extend
43  * {@link javax.servlet.http.HttpServlet}. <br />
44  * <br />
45  *
46  * E.g. <code>@WebServlet("/path")}<br />
47  * public class TestServlet extends HttpServlet ... {</code><br />
48  *
49  * E.g.
50  * <code>@WebServlet(name="TestServlet", urlPatterns={"/path", "/alt"}) <br />
51  * public class TestServlet extends HttpServlet ... {</code><br />
52  *
53  * @since Servlet 3.0 (Section 8.1.1)
54  *
55  */
56 @Target({ElementType.TYPE})
57 @Retention(RetentionPolicy.RUNTIME)
58 @Documented
59 public @interface WebServlet {
60
61     /**
62      * @return name of the Servlet
63      */
64     String name() default "";
65
66     /**
67      * A convenience method, to allow extremely simple annotation of a class.
68      *
69      * @return array of URL patterns
70      * @see #urlPatterns()
71      */
72     String[] value() default {};
73
74     /**
75      * @return array of URL patterns to which this Filter applies
76      */
77     String[] urlPatterns() default {};
78
79     /**
80      * @return load on startup ordering hint
81      */
82     int loadOnStartup() default -1;
83
84     /**
85      * @return array of initialization params for this Servlet
86      */
87     WebInitParam[] initParams() default {};
88
89     /**
90      * @return asynchronous operation supported by this Servlet
91      */
92     boolean asyncSupported() default false;
93
94     /**
95      * @return small icon for this Servlet, if present
96      */
97     String smallIcon() default "";
98
99     /**
100      * @return large icon for this Servlet, if present
101      */
102     String largeIcon() default "";
103
104     /**
105      * @return description of this Servlet, if present
106      */
107     String description() default "";
108
109     /**
110      * @return display name of this Servlet, if present
111      */
112     String displayName() default "";
113 }