Package ball.spring
Class AbstractController
- java.lang.Object
-
- ball.spring.AbstractController
-
- All Implemented Interfaces:
ErrorController
public abstract class AbstractController extends Object implements ErrorController
AbstractController
base class. ImplementsErrorController
, implementsgetViewName()
(withString.join("-", getClass().getPackage().getName().split(Pattern.quote(".")))
), providesaddDefaultModelAttributesTo(Model)
from correspondingtemplate.model.properties
, and configuresSpringResourceTemplateResolver
to use decoupled logic.Injected Field Summary
- Author:
- Allen D. Ball
-
-
Constructor Summary
Constructors Constructor Description AbstractController()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addDefaultModelAttributesTo(Model model)
void
destroy()
String
error()
String
getViewName()
String
handle(Model model, Exception exception)
String
handleNOT_FOUND(Model model, NoSuchElementException exception)
void
init()
String
webjarsjs()
-
-
-
Constructor Detail
-
AbstractController
public AbstractController()
-
-
Method Detail
-
init
@PostConstruct public void init()
-
destroy
@PreDestroy public void destroy()
-
getViewName
public String getViewName()
-
addDefaultModelAttributesTo
@ModelAttribute public void addDefaultModelAttributesTo(Model model)
-
webjarsjs
@ResponseBody @RequestMapping(value="/webjarsjs", produces="application/javascript") public String webjarsjs()
- Returns:
- The set-up javascript.
-
error
@RequestMapping("${server.error.path:${error.path:/error}}") public String error()
-
handleNOT_FOUND
@ExceptionHandler @ResponseStatus(NOT_FOUND) public String handleNOT_FOUND(Model model, NoSuchElementException exception)
-
handle
@ExceptionHandler @ResponseStatus(INTERNAL_SERVER_ERROR) public String handle(Model model, Exception exception)
-
-