Class ViewsFilter

java.lang.Object
io.micronaut.views.ViewsFilter
All Implemented Interfaces:
io.micronaut.core.order.Ordered, io.micronaut.http.filter.HttpFilter, io.micronaut.http.filter.HttpServerFilter

@Requires(beans=ViewsResolver.class) @Filter("/**") public class ViewsFilter extends Object implements io.micronaut.http.filter.HttpServerFilter
Templates Filter.
Since:
1.0
Author:
Sergio del Amo
  • Field Details

    • viewsResolver

      protected final ViewsResolver viewsResolver
      Views Resolver.
    • viewsRendererLocator

      protected final ViewsRendererLocator viewsRendererLocator
      Views Render Locator.
    • viewsModelDecorator

      protected final ViewsModelDecorator viewsModelDecorator
      Views Model Decorator.
    • turboStreamRenderer

      protected final TurboStreamRenderer turboStreamRenderer
      Turbo Stream Renderer.
    • turboFrameRenderer

      protected final TurboFrameRenderer turboFrameRenderer
      Turbo Stream Renderer.
  • Constructor Details

  • Method Details

    • getOrder

      public int getOrder()
      Specified by:
      getOrder in interface io.micronaut.core.order.Ordered
    • doFilter

      public final org.reactivestreams.Publisher<io.micronaut.http.MutableHttpResponse<?>> doFilter(io.micronaut.http.HttpRequest<?> request, io.micronaut.http.filter.ServerFilterChain chain)
      Specified by:
      doFilter in interface io.micronaut.http.filter.HttpServerFilter
    • resolveMediaType

      @NonNull protected @NonNull io.micronaut.http.MediaType resolveMediaType(@Nullable @Nullable io.micronaut.http.HttpRequest<?> request, @NonNull @NonNull io.micronaut.http.HttpResponse<?> response, @Nullable @Nullable Object responseBody)
      Resolves the response content type for the matched route.
      Parameters:
      request - HTTP Request
      response - HTTP response
      responseBody - HTTP Response body
      Returns:
      The resolved content type
    • resolveMediaType

      @Deprecated(forRemoval=true, since="4.1.0") protected io.micronaut.http.MediaType resolveMediaType(@NonNull @NonNull io.micronaut.http.HttpResponse<?> response, @Nullable @Nullable Object responseBody)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Resolves the response content type for the matched route.
      Parameters:
      response - HTTP response
      responseBody - HTTP Response body
      Returns:
      The resolved content type