Code example for WebRequest

Methods: removeAttribute

0
	@Override 
	public void cleanupAttribute(WebRequest request, String attributeName) {
		Assert.notNull(request, "WebRequest must not be null");
		Assert.notNull(attributeName, "Attribute name must not be null");
		String storeAttributeName = getAttributeNameInSession(request, attributeName);
		request.removeAttribute(storeAttributeName, WebRequest.SCOPE_SESSION);
	} 
 
 
	/** 
	 * Calculate the attribute name in the backend session. 
	 * <p>The default implementation simply prepends the configured 
	 * {@link #setAttributeNamePrefix "attributeNamePrefix"}, if any. 
	 * @param request the current request 
	 * @param attributeName the name of the attribute 
	 * @return the attribute name in the backend session 
	 */ 
	protected String getAttributeNameInSession(WebRequest request, String attributeName) {
		return this.attributeNamePrefix + attributeName;
	}