Java Code Examples for org.springframework.web.servlet.View#PATH_VARIABLES

The following examples show how to use org.springframework.web.servlet.View#PATH_VARIABLES . 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 File: PathVariableMethodArgumentResolver.java    From spring-analysis-note with MIT License 5 votes vote down vote up
@Override
@SuppressWarnings("unchecked")
protected void handleResolvedValue(@Nullable Object arg, String name, MethodParameter parameter,
		@Nullable ModelAndViewContainer mavContainer, NativeWebRequest request) {

	String key = View.PATH_VARIABLES;
	int scope = RequestAttributes.SCOPE_REQUEST;
	Map<String, Object> pathVars = (Map<String, Object>) request.getAttribute(key, scope);
	if (pathVars == null) {
		pathVars = new HashMap<>();
		request.setAttribute(key, pathVars, scope);
	}
	pathVars.put(name, arg);
}
 
Example 2
Source File: PathVariableMethodArgumentResolver.java    From java-technology-stack with MIT License 5 votes vote down vote up
@Override
@SuppressWarnings("unchecked")
protected void handleResolvedValue(@Nullable Object arg, String name, MethodParameter parameter,
		@Nullable ModelAndViewContainer mavContainer, NativeWebRequest request) {

	String key = View.PATH_VARIABLES;
	int scope = RequestAttributes.SCOPE_REQUEST;
	Map<String, Object> pathVars = (Map<String, Object>) request.getAttribute(key, scope);
	if (pathVars == null) {
		pathVars = new HashMap<>();
		request.setAttribute(key, pathVars, scope);
	}
	pathVars.put(name, arg);
}
 
Example 3
Source File: PathVariableMethodArgumentResolver.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
@Override
@SuppressWarnings("unchecked")
protected void handleResolvedValue(Object arg, String name, MethodParameter parameter,
		ModelAndViewContainer mavContainer, NativeWebRequest request) {

	String key = View.PATH_VARIABLES;
	int scope = RequestAttributes.SCOPE_REQUEST;
	Map<String, Object> pathVars = (Map<String, Object>) request.getAttribute(key, scope);
	if (pathVars == null) {
		pathVars = new HashMap<String, Object>();
		request.setAttribute(key, pathVars, scope);
	}
	pathVars.put(name, arg);
}
 
Example 4
Source File: PathVariableMethodArgumentResolver.java    From spring4-understanding with Apache License 2.0 5 votes vote down vote up
@Override
@SuppressWarnings("unchecked")
protected void handleResolvedValue(Object arg, String name, MethodParameter parameter,
		ModelAndViewContainer mavContainer, NativeWebRequest request) {

	String key = View.PATH_VARIABLES;
	int scope = RequestAttributes.SCOPE_REQUEST;
	Map<String, Object> pathVars = (Map<String, Object>) request.getAttribute(key, scope);
	if (pathVars == null) {
		pathVars = new HashMap<String, Object>();
		request.setAttribute(key, pathVars, scope);
	}
	pathVars.put(name, arg);
}