Class AbstractControllerConfig

java.lang.Object
org.javalite.activeweb.AbstractControllerConfig
All Implemented Interfaces:
InitConfig

public abstract class AbstractControllerConfig extends Object implements 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.

Filters before() methods are executed in the same order as filters are registered.

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
  • Constructor Details

    • AbstractControllerConfig

      public AbstractControllerConfig()
  • Method Details

    • add

      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 interface InitConfig