@Requires(beans=ViewsRenderer.class) @Filter(value="/**") public class ViewsFilter extends Object implements HttpServerFilter
Modifier and Type | Field and Description |
---|---|
protected BeanLocator |
beanLocator |
protected Integer |
order |
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
Constructor and Description |
---|
ViewsFilter(BeanLocator beanLocator,
io.micronaut.views.ViewsFilterOrderProvider viewsFilterOrderProvider)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
Publisher<MutableHttpResponse<?>> |
doFilter(HttpRequest<?> request,
ServerFilterChain chain)
Variation of the
HttpServerFilter.doFilter(HttpRequest, FilterChain) method that accepts a ServerFilterChain
which allows to mutate the outgoing HTTP response. |
int |
getOrder() |
protected Object |
resolveModel(Object responseBody)
Resolves the model for the given response body.
|
protected Optional<String> |
resolveView(AnnotationMetadata route,
Object responseBody)
Resolves the view for the given method and response body.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
doFilter
protected final Integer order
protected final BeanLocator beanLocator
public ViewsFilter(BeanLocator beanLocator, @Nullable io.micronaut.views.ViewsFilterOrderProvider viewsFilterOrderProvider)
beanLocator
- The bean locatorviewsFilterOrderProvider
- The order providerpublic int getOrder()
public final Publisher<MutableHttpResponse<?>> doFilter(HttpRequest<?> request, ServerFilterChain chain)
HttpServerFilter
HttpServerFilter.doFilter(HttpRequest, FilterChain)
method that accepts a ServerFilterChain
which allows to mutate the outgoing HTTP response.doFilter
in interface HttpServerFilter
request
- The requestchain
- The chainPublisher
that emits a MutableHttpResponse
HttpServerFilter.doFilter(HttpRequest, FilterChain)
protected Object resolveModel(Object responseBody)
responseBody
- Response bodyprotected Optional<String> resolveView(AnnotationMetadata route, Object responseBody)
route
- Request routeresponseBody
- Response body