Package org.javalite.activeweb
Class AbstractControllerConfig
java.lang.Object
org.javalite.activeweb.AbstractControllerConfig
- All Implemented Interfaces:
InitConfig
This class is to be sub-classed by the application level class called
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");
- Author:
- Igor Polevoy
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected AbstractControllerConfig.FilterBuilder<? extends AppController>
add(HttpSupportFilter... filters)
Adds a set of filters to a set of controllers.void
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.javalite.activeweb.InitConfig
init
-
Constructor Details
-
AbstractControllerConfig
public AbstractControllerConfig()
-
-
Method Details
-
add
protected AbstractControllerConfig.FilterBuilder<? extends AppController> add(HttpSupportFilter... filters)Adds a set of filters to a set of controllers. The filters are invoked in the order specified. Will reject adding the same instance of a filter more than once.- Parameters:
filters
- filters to be added.- Returns:
- object with
to()
method which accepts a controller class.
-
completeInit
public void completeInit()- Specified by:
completeInit
in interfaceInitConfig
-