Package javax.servlet.annotation
Annotation Type WebServlet
@Target(TYPE)
@Retention(RUNTIME)
@Documented
public @interface WebServlet
Annotation used to declare a servlet.
This annotation is processed by the container at deployment time, and the corresponding servlet made available at the specified URL patterns.
- Since:
- Servlet 3.0
- See Also:
Servlet
-
Optional Element Summary
Optional Elements Modifier and Type Optional Element Description booleanasyncSupportedDeclares whether the servlet supports asynchronous operation mode.java.lang.StringdescriptionThe description of the servletjava.lang.StringdisplayNameThe display name of the servletWebInitParam[]initParamsThe init parameters of the servletjava.lang.StringlargeIconThe large-icon of the servletintloadOnStartupThe load-on-startup order of the servletjava.lang.StringnameThe name of the servletjava.lang.StringsmallIconThe small-icon of the servletjava.lang.String[]urlPatternsThe URL patterns of the servletjava.lang.String[]valueThe URL patterns of the servlet
-
Element Details
-
name
java.lang.String nameThe name of the servlet- Returns:
- the name of the servlet
- Default:
- ""
-
value
java.lang.String[] valueThe URL patterns of the servlet- Returns:
- the URL patterns of the servlet
- Default:
- {}
-
urlPatterns
java.lang.String[] urlPatternsThe URL patterns of the servlet- Returns:
- the URL patterns of the servlet
- Default:
- {}
-
loadOnStartup
int loadOnStartupThe load-on-startup order of the servlet- Returns:
- the load-on-startup order of the servlet
- Default:
- -1
-
initParams
WebInitParam[] initParamsThe init parameters of the servlet- Returns:
- the init parameters of the servlet
- Default:
- {}
-
asyncSupported
boolean asyncSupportedDeclares whether the servlet supports asynchronous operation mode.- Returns:
trueif the servlet supports asynchronous operation mode- See Also:
ServletRequest.startAsync(),ServletRequest.startAsync( javax.servlet.ServletRequest,javax.servlet.ServletResponse)
- Default:
- false
-
smallIcon
java.lang.String smallIconThe small-icon of the servlet- Returns:
- the small-icon of the servlet
- Default:
- ""
-
largeIcon
java.lang.String largeIconThe large-icon of the servlet- Returns:
- the large-icon of the servlet
- Default:
- ""
-
description
java.lang.String descriptionThe description of the servlet- Returns:
- the description of the servlet
- Default:
- ""
-
displayName
java.lang.String displayNameThe display name of the servlet- Returns:
- the display name of the servlet
- Default:
- ""
-