/** * Set the request that we are wrapping. * * @param request The new wrapped request */ public void setRequest(ServletRequest request) { super.setRequest(request); // Initialize the attributes for this request synchronized (attributes) { attributes.clear(); Enumeration names = request.getAttributeNames(); while (names.hasMoreElements()) { String name = (String) names.nextElement(); Object value = request.getAttribute(name); attributes.put(name, value); } } }
public ServletRequestWrapper(ServletRequest request) { setRequest(request); }