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()
@ModelAttribute public void addDefaultModelAttributesTo(Model model)
@PreDestroy public void destroy()
@RequestMapping(value="${server.error.path:${error.path:/error}}") public String error()
@Deprecated public String getErrorPath()
getErrorPath
in interface ErrorController
public String getViewName()
@ExceptionHandler @ResponseStatus(value=INTERNAL_SERVER_ERROR) public String handle(Model model, Exception exception)
@ExceptionHandler @ResponseStatus(value=NOT_FOUND) public String handleNOT_FOUND(Model model, NoSuchElementException exception)
@PostConstruct public void init()
@ResponseBody @RequestMapping(value="/webjarsjs", produces="application/javascript") public String wbejarsjs()
Copyright © 2015–2020 Allen D. Ball. All rights reserved.