Code example for WebRequest

Methods: getAttribute, removeAttribute, setAttribute

0
	} 
 
	@Override 
	public void afterCompletion(WebRequest request, Exception ex) throws DataAccessException { 
		String participateAttributeName = getParticipateAttributeName(); 
		Integer count = (Integer) request.getAttribute(participateAttributeName, WebRequest.SCOPE_REQUEST); 
		if (count != null) { 
			// Do not modify the PersistenceManager: just clear the marker. 
			if (count > 1) { 
				request.setAttribute(participateAttributeName, count - 1, WebRequest.SCOPE_REQUEST); 
			} 
			else { 
				request.removeAttribute(participateAttributeName, WebRequest.SCOPE_REQUEST); 
			} 
		} 
		else { 
			PersistenceManagerHolder pmHolder = (PersistenceManagerHolder) 
					TransactionSynchronizationManager.unbindResource(getPersistenceManagerFactory()); 
			logger.debug("Closing JDO PersistenceManager in OpenPersistenceManagerInViewInterceptor"); 
			PersistenceManagerFactoryUtils.releasePersistenceManager( 
Connect your IDE to all the code out there  Get Codota for Java