Class ViewUtils
- java.lang.Object
-
- io.microsphere.spring.webmvc.util.ViewUtils
-
- All Implemented Interfaces:
io.microsphere.util.Utils
public abstract class ViewUtils extends java.lang.Object implements io.microsphere.util.UtilsViewUtilities class- Since:
- 1.0.0
- Author:
- Mercy
- See Also:
View
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.util.Map<java.lang.String,java.lang.Object>getPathVariables(org.springframework.web.context.request.RequestAttributes requestAttributes)Get a Map with path variables.static org.springframework.http.HttpStatusgetResponseStatus(org.springframework.web.context.request.RequestAttributes requestAttributes)Get theHttpStatusfor theViewstatic org.springframework.http.MediaTypegetSelectedContentType(org.springframework.web.context.request.RequestAttributes requestAttributes)Get theMediaTypeselected during content negotiation, which may be more specific than the one the View is configured with.
-
-
-
Method Detail
-
getResponseStatus
@Nullable public static org.springframework.http.HttpStatus getResponseStatus(org.springframework.web.context.request.RequestAttributes requestAttributes)
Get theHttpStatusfor theView- Parameters:
requestAttributes- theRequestAttributes- Returns:
- the
HttpStatusif set, otherwisenull - See Also:
View.RESPONSE_STATUS_ATTRIBUTE
-
getPathVariables
@Nullable public static java.util.Map<java.lang.String,java.lang.Object> getPathVariables(org.springframework.web.context.request.RequestAttributes requestAttributes)
Get a Map with path variables. The map consists of String-based URI template variable names as keys and their corresponding Object-based values -- extracted from segments of the URL and type converted.- Parameters:
requestAttributes- theRequestAttributes- Returns:
- The map consists of String-based URI template variable names as keys and their corresponding Object-based values -- extracted from segments of the URL and type converted.
- See Also:
View.PATH_VARIABLES
-
getSelectedContentType
@Nullable public static org.springframework.http.MediaType getSelectedContentType(org.springframework.web.context.request.RequestAttributes requestAttributes)
Get theMediaTypeselected during content negotiation, which may be more specific than the one the View is configured with. For example: "application/vnd.example-v1+xml" vs "application/*+xml".- Parameters:
requestAttributes- theRequestAttributes- Returns:
- the
MediaTypeif selected, otherwisenull - See Also:
View.SELECTED_CONTENT_TYPE
-
-