|
Servlet 3.0 - Apache Tomcat 7.0.28 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT |
@Target(value=TYPE) @Retention(value=RUNTIME) @Documented public @interface WebServlet
This annotation is used to declare the configuration of an
Servlet
.
If the name attribute is not defined, the fully qualified name of the class
is used.
At least one URL pattern MUST be declared in either the value
or
urlPattern
attribute of the annotation, but not both.
The value
attribute is recommended for use when the URL pattern is
the only attribute being set, otherwise the urlPattern
attribute
should be used.
The class on which this annotation is declared MUST extend
HttpServlet
.
E.g. @WebServlet("/path")}
public class TestServlet extends HttpServlet ... {
E.g.
@WebServlet(name="TestServlet", urlPatterns={"/path", "/alt"})
public class TestServlet extends HttpServlet ... {
Optional Element Summary | |
---|---|
boolean |
asyncSupported
|
java.lang.String |
description
|
java.lang.String |
displayName
|
WebInitParam[] |
initParams
|
java.lang.String |
largeIcon
|
int |
loadOnStartup
|
java.lang.String |
name
|
java.lang.String |
smallIcon
|
java.lang.String[] |
urlPatterns
|
java.lang.String[] |
value
A convenience method, to allow extremely simple annotation of a class. |
public abstract java.lang.String name
public abstract java.lang.String[] value
urlPatterns()
public abstract java.lang.String[] urlPatterns
public abstract int loadOnStartup
public abstract WebInitParam[] initParams
public abstract boolean asyncSupported
public abstract java.lang.String smallIcon
public abstract java.lang.String largeIcon
public abstract java.lang.String description
public abstract java.lang.String displayName
|
Servlet 3.0 - Apache Tomcat 7.0.28 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT |