FileDocCategorySizeDatePackage
ReqListener.javaAPI DocExample613Fri May 30 06:16:10 BST 2003com.jspservletcookbook

ReqListener

public class ReqListener extends Object implements ServletRequestListener

Fields Summary
private static long
reqCount
Constructors Summary
Methods Summary
public voidrequestDestroyed(javax.servlet.ServletRequestEvent sre)


public voidrequestInitialized(javax.servlet.ServletRequestEvent sre)


    
   ServletContext context = sre.getServletContext();
   ServletRequest request = sre.getServletRequest();
   
  synchronized (context){
   context.log("Request for "+
       (request instanceof HttpServletRequest ? ((HttpServletRequest) request).getRequestURI() : "Unknown")+"; Count="+ ++reqCount);
   }