List of filters, typically provided by mixing in play.filters.HttpFiltersComponents or play.api.NoHttpFiltersComponents.
List of filters, typically provided by mixing in play.filters.HttpFiltersComponents or play.api.NoHttpFiltersComponents.
In most cases you will want to mixin HttpFiltersComponents and append your own filters:
class MyComponents(context: ApplicationLoader.Context) extends BuiltInComponentsFromContext(context) with play.filters.HttpFiltersComponents { lazy val loggingFilter = new LoggingFilter() override def httpFilters = { super.httpFilters :+ loggingFilter } }
If you want to filter elements out of the list, you can do the following:
class MyComponents(context: ApplicationLoader.Context) extends BuiltInComponentsFromContext(context) with play.filters.HttpFiltersComponents { override def httpFilters = { super.httpFilters.filterNot(_.getClass == classOf[CSRFFilter]) } }
Helper to provide the Play built in components.