{
Defense.isAssignable(parameter, DirectServiceParameter.class, "parameter");
DirectServiceParameter dsp = (DirectServiceParameter) parameter;
IComponent component = dsp.getDirect();
// New since 1.0.1, we use the component to determine
// the page, not the cycle. Through the use of tricky
// things such as Block/InsertBlock, it is possible
// that a component from a page different than
// the response page will render.
// In 1.0.6, we start to record *both* the render page
// and the component page (if different).
IPage activePage = cycle.getPage();
IPage componentPage = component.getPage();
Map parameters = new HashMap();
boolean stateful = _request.getSession(false) != null;
parameters.put(ServiceConstants.SERVICE, Tapestry.DIRECT_SERVICE);
parameters.put(ServiceConstants.PAGE, activePage.getPageName());
parameters.put(ServiceConstants.COMPONENT, component.getIdPath());
parameters.put(ServiceConstants.CONTAINER, componentPage == activePage ? null
: componentPage.getPageName());
parameters.put(ServiceConstants.SESSION, stateful ? "T" : null);
parameters.put(ServiceConstants.PARAMETER, dsp.getServiceParameters());