2.14.1. Controller in Action

2.14.1.1. Building controller
2.14.1.2. Controller configuration (controller.xml)

The WebAppController is the component of GateIn that processes HTTP invocations and transforms them into a portal request. It has been improved with the addition of a request mapping engine (controller) whose role is to make the HTTP request decouple and create a portal request. The mapping engine makes two essential tasks:

The goal of the controller (mapping engine) is to decouple the request processed by GateIn from the incoming HTTP request. Indeed, a request contains data that determine how the request will be processed and such data can be encoded in various places in the request, such as the request path, or a query parameter. The controller allows GateIn to route a request according to a set of parameters (a map) instead of the servlet request.

The controller configuration is declarative in an .xml file named controller.xml, allowing easy reconfiguration of the routing table and it is processed into an internal data structure that is used to perform resolution (routing or rendering).

The controller data cannot be modified by using the portlet interface, but can be still changed at runtime by modifying in the controller.xml file, then calling the WebAppController.reloadConfiguration() method.

Copyright ©. All rights reserved. eXo Platform SAS
blog comments powered byDisqus