Class ControllerUtils
java.lang.Object
uk.ac.manchester.spinnaker.alloc.web.ControllerUtils
Utilities to support MVC controllers.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
The URI path to use to change passwords.static final String
The change password URI variable for JSP pages.static final String
The URI path to use to perform OIDC logins.static final String
The OIDC URI variable for JSP pages.static final String
The URI path to use to perform logins.static final String
The logout URI variable for JSP pages.static final String
The URI path to use to perform logouts.static final String
The login URI variable for JSP pages.static final String
The main URI variable for JSP pages.static final String
The name of the Spring MVC error view.static final String
The URI path of the Spalloc CSS file.static final String
The Spalloc CSS URI variable for JSP pages.static final String
The URI path of the Spalloc JS file.static final String
The Spalloc JS URI variable for JSP pages. -
Method Summary
Modifier and TypeMethodDescriptionstatic ModelAndView
Create a view that shows an error to the user.static String
errorMessage
(ObjectError error) Convert a problem with validation into a user-suitable error message.static URI
Convert the result of calling a component builder delegate into a URL.
-
Field Details
-
MVC_ERROR
The name of the Spring MVC error view.- See Also:
-
MAIN_URI
The main URI variable for JSP pages.- See Also:
-
CHANGE_PASSWORD_URI
The change password URI variable for JSP pages.- See Also:
-
LOGOUT_URI
The login URI variable for JSP pages.- See Also:
-
LOGIN_URI
The logout URI variable for JSP pages.- See Also:
-
LOGIN_OIDC_URI
The OIDC URI variable for JSP pages.- See Also:
-
SPALLOC_CSS_URI
The Spalloc CSS URI variable for JSP pages.- See Also:
-
SPALLOC_JS_URI
The Spalloc JS URI variable for JSP pages.- See Also:
-
LOGIN_PATH
The URI path to use to perform logins.- See Also:
-
LOGIN_OIDC_PATH
The URI path to use to perform OIDC logins.- See Also:
-
CHANGE_PASSWORD_PATH
The URI path to use to change passwords.- See Also:
-
LOGOUT_PATH
The URI path to use to perform logouts.- See Also:
-
SPALLOC_CSS_PATH
The URI path of the Spalloc CSS file.- See Also:
-
SPALLOC_JS_PATH
The URI path of the Spalloc JS file.- See Also:
-
-
Method Details
-
uri
Convert the result of calling a component builder delegate into a URL. Fixes the scheme tohttps
and always ignores the query part.Do not define a
static
variable holding the result ofMvcUriComponentsBuilder.on(Class)
; it tries to be request-aware, and that defeats it. Rely on the Spring MVC core to do the relevant object caching.- Parameters:
selfCall
- component builder delegate resultobjects
- Values to substitute into the template; can be none at all- Returns:
- URL that will invoke the method
- See Also:
-
error
Create a view that shows an error to the user.- Parameters:
message
- The error message.- Returns:
- The view.
-
errorMessage
Convert a problem with validation into a user-suitable error message.- Parameters:
error
- The error detail.- Returns:
- The message.
-