I am implementing ServletRequestListener and overriding its methods requestInitialized and requestDestroyed.
When requestDestroyed is called, I want to know details like whether the request is a GET/POST request and the parameters sent along with it. What should be the approach?
public void requestDestroyed(ServletRequestEvent event) {
ServletRequest s = event.getServletRequest();
//use this to get those details
From the
ServletRequestEventpassed to theServletRequestListeneryou implemented, callgetServletRequestto get aServletRequestobject. Then cast to the subinterface,HttpServletRequest.From there you can interrogate for parts of the URL. See this post for a handy diagram of the various parts of a URL mapped to various methods on that class.