Category: Servlet

java servlet tutorials

Servlet Basic Authentication XML Configuration

This tutorial explains how to configure Servlet Basic Authentication XML configuration. If you are planning on using basic authentication you must be aware that if you use plain HTTP requests your username and password...
java servlet tutorials

Servlet Redirect HTTP Request Example

In this example we will redirect an HTTP Request from one servlet to another servlet. The sendRedirect() method of the HttpServletResponse sends a temporary redirect response to the client. This redirect sets the status...
java servlet tutorials

Servlet forward HTTP Request Example

In this example we will forward an HTTP Request from a servlet to another servlet. The forward method of the RequestDispatcher will forward a request from a servlet to another resource. This can be...
java servlet tutorials

HttpSessionIdListener Example Use Case

This example explains how to use a HttpSessionIdListener in a web application. It’s an interface for receiving notification events about HttpSession id changes. The HttpSessionIdListener can be registerd by @WebListener annotation, adding the listener...
java servlet tutorials

HttpSessionActivationListener Example Use Case

This example explains how to use a HttpSessionActivationListener in a web application. Objects that are bound to the HttpSession may listen to container events notifying them that sessions will be passivated and that session...
java servlet tutorials

HttpSessionBindingListener Example Use Case

This example explains how to use a HttpSessionBindingListener in a web application. This interface must be placed on an Object. It causes the Object to be notified when it is bound or unbound from...
java servlet tutorials

HttpSessionAttributeListener Example Use Case

This example explains how to use a HttpSessionAttributeListener in a web application. This interface is used for receiving notification events about HttpSession attribute changes. The HttpSessionAttributeListener can be registerd by @WebListener annotation, adding the...