ServletRequestEvent class gives notification about lifecycle events for a ServletRequest. The source of the event is the ServletContext of the web application. ServletRequestListener receives the notifications generated by ServletRequestEvent and performs some specified tasks based on them.
|void ||is invoked when request is about to go out of scope of the web application..|
|void ||is invoked when request is about to come into scope of the web application.|
Hence one can easily implement the ServletRequestListener Interface and provide definitions to the two methods provided by it,
As the name suggests these methods will be called when request is initialized and when it is destroyed, hence we can use them for various purposes, like variable cleanup when request is destroyed, or performing some initial checks when request is received etc.