O'Reilly logo

Servlet & JSP: A Tutorial, Second Edition by Budi Kurniawan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Appendix D

Web Annotations

Servlet 3.0 added a set of annotation types to the API. These annotation types belong in the javax.servlet.annotation package and are used to annotate web objects such as servlets, filters, and listeners. This Appendix lists the annotation types.

HandlesTypes

This annotation type is used to declare the class types that a ServletContainerInitializer can handle. It has one attribute, value, that is used to declare the class types. For example, the following ServletContainerInitializer is annotated with @HandleTypes that declares that the initializer can handle UsefulServlet.

@HandlesTypes({UsefulServlet.class})
public class MyInitializer implements ServletContainerInitializer {
    ...
}

HttpConstraint

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required