The MasterDispatcher is a chain-of-command of individual Dispatchers, each handling (like a servlet) a particular kind of incoming request.
/**
* RootPath
* Renders the start page for the "/" request
* Asset
* Provides access to classpath assets
* PageRender
* Identifies the PageRenderRequestParameters and forwards onto PageRenderRequestHandler
* ComponentEvent
* Identifies the ComponentEventRequestParameters and forwards onto the ComponentEventRequestHandler
*/
public void contributeMasterDispatcher(OrderedConfiguration
ObjectLocator locator)
{
// Looks for the root path and renders the start page. This is maintained for compatibility
// with earlier versions of Tapestry 5, it is recommended that an Index page be used instead.
configuration.add("RootPath",
locator.autobuild(RootPathDispatcher.class),
"before:Asset");
// This goes first because an asset to be streamed may have an file extension, such as
// ".html", that will confuse the later dispatchers.
configuration.add("Asset",
locator.autobuild(AssetDispatcher.class), "before:ComponentEvent");
configuration.add("ComponentEvent", locator.autobuild(ComponentEventDispatcher.class),
"before:PageRender");
configuration.add("PageRender",
locator.autobuild(PageRenderDispatcher.class));
}
No comments:
Post a Comment