Category: Servlet

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 code...
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 either...
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 to...
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 will...
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 an...
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 listener...