public abstract class AbstractControllerConfig<T extends AppController> extends Object implements AppConfig
app.config.AppControllerConfig
.
This class provides ways to bind filters to controllers.
See HttpSupportFilter
.
Adding controller filters:add(org.javalite.activeweb.controller_filters.HttpSupportFilter...)
)}
Not specifying controllers in the to(...)
method adds filters to all controllers.
Filters' after() methods are executed in the opposite order as filters are registered.
Here is an example of adding a filter to specific actions:
add(mew TimingFilter(), new DBConnectionFilter()).to(PostsController.class).forActions("index", "show");
Modifier and Type | Class and Description |
---|---|
class |
AbstractControllerConfig.FilterBuilder |
Constructor and Description |
---|
AbstractControllerConfig() |
Modifier and Type | Method and Description |
---|---|
protected AbstractControllerConfig.FilterBuilder |
add(HttpSupportFilter... filters)
Adds a set of filters to a set of controllers.
|
protected AbstractControllerConfig.FilterBuilder |
addGlobalFilters(HttpSupportFilter... filters)
Deprecated.
|
void |
completeInit() |
protected AbstractControllerConfig.FilterBuilder add(HttpSupportFilter... filters)
filters
- filters to be added.to()
method which accepts a controller class.protected AbstractControllerConfig.FilterBuilder addGlobalFilters(HttpSupportFilter... filters)
add(HttpSupportFilter[])
.... addGlobalFilters(new TimingFilter(), new DBConnectionFilter()); ...
filters
- filters to be added.public void completeInit()
completeInit
in interface AppConfig
Copyright © 2019. All rights reserved.