Oracle Logo

Example of Servlet 3.0 Annotation

 

New Annotation

Three annotations, @WebServlet, @WebFilter, and @WebListener, were added to Servlet 3.0. With these annotations, we do not need to use corresponding tags during configuration through the web.xml deployment descriptor file.

Description of Example

Servlet, Filter, and Listener are defined with corresponding annotations to greet the user.

Use This Example

Click "Run" to run this example and display the greetings from Servlet, Filter, and Listener.