Class 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 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()