public abstract class AbstractController extends Object implements ErrorController
Controller
base class.
Implements ErrorController
, implements getViewName()
(with
String.join("-", getClass().getPackage().getName().split(Pattern.quote(".")))
),
provides addDefaultModelAttributesTo(Model)
from corresponding
template.model.properties
, and configures
SpringResourceTemplateResolver
to use decoupled logic.
Constructor and Description |
---|
AbstractController() |
Modifier and Type | Method and Description |
---|---|
void |
addDefaultModelAttributesTo(Model model) |
void |
destroy() |
String |
error() |
String |
getErrorPath()
Deprecated.
|
String |
getViewName() |
String |
handle(Model model,
Exception exception) |
String |
handleNOT_FOUND(Model model,
NoSuchElementException exception) |
void |
init() |
String |
wbejarsjs()
|
public AbstractController()
@PostConstruct public void init()
@PreDestroy public void destroy()
public String getViewName()
@ModelAttribute public void addDefaultModelAttributesTo(Model model)
@ResponseBody @RequestMapping(value="/webjarsjs", produces="application/javascript") public String wbejarsjs()
@RequestMapping(value="${server.error.path:${error.path:/error}}") public String error()
@ExceptionHandler @ResponseStatus(value=NOT_FOUND) public String handleNOT_FOUND(Model model, NoSuchElementException exception)
@ExceptionHandler @ResponseStatus(value=INTERNAL_SERVER_ERROR) public String handle(Model model, Exception exception)
@Deprecated public String getErrorPath()
getErrorPath
in interface ErrorController
Copyright © 2015–2020 Allen D. Ball. All rights reserved.