Class GlobalControllerAdvice
- java.lang.Object
-
- de.digitalcollections.cudami.admin.controller.advice.GlobalControllerAdvice
-
@ControllerAdvice public class GlobalControllerAdvice extends Object
Adds the webapp version read from application.yml as global model attribute and initializes custom property editors.
-
-
Constructor Summary
Constructors Constructor Description GlobalControllerAdvice(RoleEditor roleEditor, String version)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getVersion()
String
handleResourceNotFoundException(org.springframework.ui.Model model)
void
registerCustomEditors(org.springframework.web.bind.WebDataBinder binder, org.springframework.web.context.request.WebRequest request)
-
-
-
Constructor Detail
-
GlobalControllerAdvice
public GlobalControllerAdvice(RoleEditor roleEditor, @Value("${info.app.project.version}") String version)
-
-
Method Detail
-
handleResourceNotFoundException
@ExceptionHandler(de.digitalcollections.model.exception.ResourceNotFoundException.class) @ResponseStatus(NOT_FOUND) public String handleResourceNotFoundException(org.springframework.ui.Model model)
-
registerCustomEditors
@InitBinder public void registerCustomEditors(org.springframework.web.bind.WebDataBinder binder, org.springframework.web.context.request.WebRequest request)
-
getVersion
@ModelAttribute("version") public String getVersion()
-
-