Category: Java
Disable Http Session in Java Web Application
In this example we will enforce the prevention of using Http Session in a Web Application. If you are working in a Team and you want to enforce your team to not using the...
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...
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...
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...
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...
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...
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...
Track Active Sessions with HttpSessionListener Example Use Case
This example explains how to use a HttpSessionListener in a web application. The purpose of this interface is to track active sessions in a web application. The HttpSessionListener can be registerd by @WebListener annotation,...
ServletRequestListener Example Use Case
This example explains how to use a ServletRequestListener in a web application. This interface is used for receiving notification events about requests coming into and going out of scope of a web application. Notifications...