Java Code Examples for org.springframework.web.method.annotation.SessionAttributesHandler

Following code examples demonstrate how to use org.springframework.web.method.annotation.SessionAttributesHandlerfrom spring-framework. These examples are extracted from various highly rated open source projects. You can directly use these code snippets or view their entire linked source code. These snippets are extracted to provide contextual information about how to use this class in the real world. These samples also let you understand some good practices on how to use org.springframework.web.method.annotation.SessionAttributesHandlerand various code implementation of this class.

	private boolean hasSessionAttributes(Class<?> handlerType) {
		SessionAttributesHandler handler = null;
		synchronized(this.sessionAttributesHandlerCache) {
			handler = this.sessionAttributesHandlerCache.get(handlerType);
			if (handler == null) {
				handler = new SessionAttributesHandler(handlerType, sessionAttributeStore);
				this.sessionAttributesHandlerCache.put(handlerType, handler);
			}
		}
		return handler.hasSessionAttributes();
	} 


	private boolean supportsReturnType(MethodParameter methodReturnType) {
		return (this.returnValueHandlers.supportsReturnType(methodReturnType) || Void.TYPE
				.equals(methodReturnType.getParameterType()));
	} 

Advertisement
Javadoc
Manages controller-specific session attributes declared via SessionAttributes @SessionAttributes. Ac

tual storage is delegated to a SessionAttributeStore instance.

When a controller annotated with @SessionAttributes adds attributes to its model, those attributes are checked against names and types specified via @SessionAttributes. Matching model attributes are saved in the HTTP session and remain there until the controller calls SessionStatus#setComplete(). @author Rossen Stoyanchev @author Juergen Hoeller @since 3.1

Read More
Advertisement