Java Code Examples for org.springframework.web.bind.support.SessionAttributeStore

The following examples show how to use org.springframework.web.bind.support.SessionAttributeStore. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: spring-analysis-note   Source File: SessionAttributesHandler.java    License: MIT License 5 votes vote down vote up
/**
 * Create a new session attributes handler. Session attribute names and types
 * are extracted from the {@code @SessionAttributes} annotation, if present,
 * on the given type.
 * @param handlerType the controller type
 * @param sessionAttributeStore used for session access
 */
public SessionAttributesHandler(Class<?> handlerType, SessionAttributeStore sessionAttributeStore) {
	Assert.notNull(sessionAttributeStore, "SessionAttributeStore may not be null");
	this.sessionAttributeStore = sessionAttributeStore;

	SessionAttributes ann = AnnotatedElementUtils.findMergedAnnotation(handlerType, SessionAttributes.class);
	if (ann != null) {
		Collections.addAll(this.attributeNames, ann.names());
		Collections.addAll(this.attributeTypes, ann.types());
	}
	this.knownAttributeNames.addAll(this.attributeNames);
}
 
Example 2
Source Project: java-technology-stack   Source File: SessionAttributesHandler.java    License: MIT License 5 votes vote down vote up
/**
 * Create a new session attributes handler. Session attribute names and types
 * are extracted from the {@code @SessionAttributes} annotation, if present,
 * on the given type.
 * @param handlerType the controller type
 * @param sessionAttributeStore used for session access
 */
public SessionAttributesHandler(Class<?> handlerType, SessionAttributeStore sessionAttributeStore) {
	Assert.notNull(sessionAttributeStore, "SessionAttributeStore may not be null");
	this.sessionAttributeStore = sessionAttributeStore;

	SessionAttributes ann = AnnotatedElementUtils.findMergedAnnotation(handlerType, SessionAttributes.class);
	if (ann != null) {
		Collections.addAll(this.attributeNames, ann.names());
		Collections.addAll(this.attributeTypes, ann.types());
	}
	this.knownAttributeNames.addAll(this.attributeNames);
}
 
Example 3
/**
 * Create a new instance for a controller type. Session attribute names and
 * types are extracted from the {@code @SessionAttributes} annotation, if
 * present, on the given type.
 * @param handlerType the controller type
 * @param sessionAttributeStore used for session access
 */
public SessionAttributesHandler(Class<?> handlerType, SessionAttributeStore sessionAttributeStore) {
	Assert.notNull(sessionAttributeStore, "SessionAttributeStore may not be null");
	this.sessionAttributeStore = sessionAttributeStore;

	SessionAttributes annotation =
			AnnotatedElementUtils.findMergedAnnotation(handlerType, SessionAttributes.class);
	if (annotation != null) {
		this.attributeNames.addAll(Arrays.asList(annotation.names()));
		this.attributeTypes.addAll(Arrays.asList(annotation.types()));
	}
	this.knownAttributeNames.addAll(this.attributeNames);
}
 
Example 4
Source Project: lams   Source File: HandlerMethodInvoker.java    License: GNU General Public License v2.0 5 votes vote down vote up
public HandlerMethodInvoker(HandlerMethodResolver methodResolver, WebBindingInitializer bindingInitializer,
		SessionAttributeStore sessionAttributeStore, ParameterNameDiscoverer parameterNameDiscoverer,
		WebArgumentResolver[] customArgumentResolvers, HttpMessageConverter<?>[] messageConverters) {

	this.methodResolver = methodResolver;
	this.bindingInitializer = bindingInitializer;
	this.sessionAttributeStore = sessionAttributeStore;
	this.parameterNameDiscoverer = parameterNameDiscoverer;
	this.customArgumentResolvers = customArgumentResolvers;
	this.messageConverters = messageConverters;
}
 
Example 5
/**
 * Create a new instance for a controller type. Session attribute names and
 * types are extracted from the {@code @SessionAttributes} annotation, if
 * present, on the given type.
 * @param handlerType the controller type
 * @param sessionAttributeStore used for session access
 */
public SessionAttributesHandler(Class<?> handlerType, SessionAttributeStore sessionAttributeStore) {
	Assert.notNull(sessionAttributeStore, "SessionAttributeStore may not be null.");
	this.sessionAttributeStore = sessionAttributeStore;

	SessionAttributes annotation = AnnotationUtils.findAnnotation(handlerType, SessionAttributes.class);
	if (annotation != null) {
		this.attributeNames.addAll(Arrays.asList(annotation.names()));
		this.attributeTypes.addAll(Arrays.asList(annotation.types()));
	}

	for (String attributeName : this.attributeNames) {
		this.knownAttributeNames.add(attributeName);
	}
}
 
Example 6
public HandlerMethodInvoker(HandlerMethodResolver methodResolver, WebBindingInitializer bindingInitializer,
		SessionAttributeStore sessionAttributeStore, ParameterNameDiscoverer parameterNameDiscoverer,
		WebArgumentResolver[] customArgumentResolvers, HttpMessageConverter<?>[] messageConverters) {

	this.methodResolver = methodResolver;
	this.bindingInitializer = bindingInitializer;
	this.sessionAttributeStore = sessionAttributeStore;
	this.parameterNameDiscoverer = parameterNameDiscoverer;
	this.customArgumentResolvers = customArgumentResolvers;
	this.messageConverters = messageConverters;
}
 
Example 7
Source Project: MaxKey   Source File: AuthorizationEndpoint.java    License: Apache License 2.0 4 votes vote down vote up
public void setSessionAttributeStore(SessionAttributeStore sessionAttributeStore) {
	this.sessionAttributeStore = sessionAttributeStore;
}
 
Example 8
/**
 * Specify the strategy to store session attributes with. The default is
 * {@link org.springframework.web.bind.support.DefaultSessionAttributeStore},
 * storing session attributes in the HttpSession with the same attribute
 * name as in the model.
 */
public void setSessionAttributeStore(SessionAttributeStore sessionAttributeStore) {
	this.sessionAttributeStore = sessionAttributeStore;
}
 
Example 9
/**
 * Specify the strategy to store session attributes with. The default is
 * {@link org.springframework.web.bind.support.DefaultSessionAttributeStore},
 * storing session attributes in the HttpSession with the same attribute
 * name as in the model.
 */
public void setSessionAttributeStore(SessionAttributeStore sessionAttributeStore) {
	this.sessionAttributeStore = sessionAttributeStore;
}
 
Example 10
/**
 * Specify the strategy to store session attributes with.
 * <p>Default is {@link org.springframework.web.bind.support.DefaultSessionAttributeStore},
 * storing session attributes in the HttpSession, using the same attribute name as in the model.
 */
public void setSessionAttributeStore(SessionAttributeStore sessionAttributeStore) {
	Assert.notNull(sessionAttributeStore, "SessionAttributeStore must not be null");
	this.sessionAttributeStore = sessionAttributeStore;
}
 
Example 11
/**
 * Specify the strategy to store session attributes with. The default is
 * {@link org.springframework.web.bind.support.DefaultSessionAttributeStore},
 * storing session attributes in the HttpSession with the same attribute
 * name as in the model.
 */
public void setSessionAttributeStore(SessionAttributeStore sessionAttributeStore) {
	this.sessionAttributeStore = sessionAttributeStore;
}
 
Example 12
/**
 * Specify the strategy to store session attributes with.
 * <p>Default is {@link org.springframework.web.bind.support.DefaultSessionAttributeStore},
 * storing session attributes in the PortletSession, using the same
 * attribute name as in the model.
 */
public void setSessionAttributeStore(SessionAttributeStore sessionAttributeStore) {
	Assert.notNull(sessionAttributeStore, "SessionAttributeStore must not be null");
	this.sessionAttributeStore = sessionAttributeStore;
}
 
Example 13
/**
 * Specify the strategy to store session attributes with.
 * <p>Default is {@link org.springframework.web.bind.support.DefaultSessionAttributeStore},
 * storing session attributes in the HttpSession, using the same attribute name as in the model.
 */
public void setSessionAttributeStore(SessionAttributeStore sessionAttributeStore) {
	Assert.notNull(sessionAttributeStore, "SessionAttributeStore must not be null");
	this.sessionAttributeStore = sessionAttributeStore;
}
 
Example 14
/**
 * Specify the strategy to store session attributes with. The default is
 * {@link org.springframework.web.bind.support.DefaultSessionAttributeStore},
 * storing session attributes in the HttpSession with the same attribute
 * name as in the model.
 */
public void setSessionAttributeStore(SessionAttributeStore sessionAttributeStore) {
	this.sessionAttributeStore = sessionAttributeStore;
}