Package play.components
Interface HttpComponents
-
- All Superinterfaces:
HttpConfigurationComponents
- All Known Subinterfaces:
BuiltInComponents
,HttpFiltersComponents
,NoHttpFiltersComponents
- All Known Implementing Classes:
BuiltInComponentsFromContext
,ContextBasedBuiltInComponents
,RoutingDslComponentsFromContext
public interface HttpComponents extends HttpConfigurationComponents
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ActionCreator
actionCreator()
List<EssentialFilter>
httpFilters()
List of filters, typically provided by mixing in play.filters.HttpFiltersComponents or play.api.NoHttpFiltersComponents.HttpRequestHandler
httpRequestHandler()
play.core.j.JavaHandlerComponents
javaHandlerComponents()
-
Methods inherited from interface play.components.HttpConfigurationComponents
httpConfiguration, sessionConfiguration
-
-
-
-
Method Detail
-
actionCreator
ActionCreator actionCreator()
-
httpFilters
List<EssentialFilter> httpFilters()
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:
public class MyComponents extends BuiltInComponentsFromContext implements HttpFiltersComponents { public MyComponents(ApplicationLoader.Context context) { super(context); } public List<EssentialFilter> httpFilters() { List<EssentialFilter> filters = HttpFiltersComponents.super.httpFilters(); filters.add(loggingFilter); return filters; } // other required methods }
If you want to filter elements out of the list, you can do the following:class MyComponents extends BuiltInComponentsFromContext implements HttpFiltersComponents { public MyComponents(ApplicationLoader.Context context) { super(context); } public List<EssentialFilter> httpFilters() { return httpFilters().stream() // accept only filters that are not CSRFFilter .filter(f -> !f.getClass().equals(CSRFFilter.class)) .collect(Collectors.toList()); } // other required methods }
- Returns:
- an array with the http filters.
- See Also:
EssentialFilter
-
javaHandlerComponents
play.core.j.JavaHandlerComponents javaHandlerComponents()
-
httpRequestHandler
HttpRequestHandler httpRequestHandler()
-
-