Class HttpPathVariableController

java.lang.Object
com.chillycheesy.modulo.controllers.HttpPathVariableController
All Implemented Interfaces:
Controller

public class HttpPathVariableController extends Object implements Controller
Controller that check if the pathVariable match with the target path. If the path match then return the next controller result. The path variable include some expression.
  • {<key>}: The path variable. The key is the name of the path variable. If the path match with the request path, the apply method register the key inside a "path-variable" section with the equivalent value inside the configuration.
    Exemple: /{value} match with /test and register the key path-variable.value with the value test.
  • *: match any path but don't register it inside the configuration.
    Exemple: /my/* match with /my/test.
  • /**: match any additional path but don't register it inside the configuration. it should be place at the end of the path
    Exemple: /my/** match with /my/test and /my/test/test2 and /my/test/test2/test3. Register the additional path inside the configuration at the key "additional-path".
  • Field Details

  • Constructor Details

  • Method Details

    • apply

      public Object apply(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, Configuration configuration) throws Exception
      Apply the controller. If the path match with the target pathVariable then Register all find variable inside the configuration and return the next controller result.
      Specified by:
      apply in interface Controller
      Parameters:
      request - the http request.
      response - the http response.
      configuration - the configuration.
      Returns:
      The response.
      Throws:
      Exception
    • setNextStep

      public void setNextStep(Controller controller)
      Set the next controller.
      Specified by:
      setNextStep in interface Controller
      Parameters:
      controller - the next controller.