BuiltinController
Base class for built-in controllers provided by Elide.
"Built-in" controllers are mounted within the application context by default, and handle events like global 404 Not Found
and upstream call failures.
Built-in controllers
Each built-in controller operates at the default @Singleton
scope, and complies with StatusEnabledController. As such, state tied to individual requests is not allowed on built-in controllers unless proper synchronization is used.
Users can replace built-in controllers via Micronaut annotations. See below for more.
Overriding built-in controllers
To override a built-in controller, implement BaseController and annotate your class as follows:
@Controller
@Replaces(SomeBuiltinController::class)
class MyController {
// ...
}
Default built-in controllers
The following built-in controllers are provided by the framework by default:
NotFoundController: handles
404 Not Found
events by rendering a designated HTML template.ServerErrorController: handles generic
500 Internal Server Error
events via a designated HTML template.
Low-level error handler
General/low-level error handling is provided at the executor level by UncaughtExceptionHandler, which can also be customized / replaced via the same mechanism shown above. See docs on that class for more info.
See also
for the built-in controller which handles 404 Not Found
events.
for the built-in controller which handles generic internal error events.
for customizable background error handling logic.
Inheritors
Functions
Handles a request to this built-in controller.
Responds to a client with an HTML response, using specified block to build an HTML page via Kotlin's HTML DSL.