日期:2014-05-20 浏览次数:20727 次
public class MyRequestListener implements ServletRequestListener,ServletRequestAttributeListener{ public void requestDestroyed(ServletRequestEvent arg0) { //对销毁客户端请求进行监听 print("reqeust destroyed"); } public void requestInitialized(ServletRequestEvent arg0) { //对实现客户端请求进行监听 print("Request init"); ServletRequest sr = arg0.getServletRequest(); //初始化客户端请求 print(sr.getRemoteAddr()); //获得请求客户端的地址 }