Page

@Bean
@Target(allowedTargets = [AnnotationTarget.CLASS])
@Controller
@DefaultScope(value = Singleton::class)
annotation class Page(val route: String = UriMapping.DEFAULT_URI, val name: String = "", val produces: Array<String> = [MediaType.TEXT_HTML], val consumes: Array<String> = [], val precompile: Boolean = true)

Annotations which is applied to handlers which respond to HTTP requests with HTTP responses, typically encoded in HTML, for the purpose of presenting a user interface.

The Micronaut annotations Controller behaves in essentially the same manner as Page, but with different defaults and available settings.

Parameters

route

HTTP route that should be bound to this page.

name

Name to use when generating links for this route.

produces

Types produced by this page; defaults to text/html.

consumes

Types consumed by this page; defaults to nothing.

precompile

Whether this page handler should be considered for pre-compiled sites. Defaults to true.

Properties

Link copied to clipboard
@get:AliasFor(annotation = Consumes::class)
val consumes: Array<String>

Content-Type consumed by this endpoint; defaults to JSON.

Link copied to clipboard

Name for this route.

Link copied to clipboard
val precompile: Boolean = true

Enable pre-compilation for this page (i.e. via SSG).

Link copied to clipboard
@get:AliasFor(annotation = Produces::class)
val produces: Array<String>

Content-Type produced by this endpoint; defaults to HTML.

Link copied to clipboard
@get:AliasFor(annotation = UriMapping::class)
val route: String

HTTP route that should be bound to this page.