Package fitnesse.responders

Source Code of fitnesse.responders.DefaultResponder

// Copyright (C) 2003-2009 by Object Mentor, Inc. All rights reserved.
// Released under the terms of the CPL Common Public License version 1.0.
package fitnesse.responders;

import fitnesse.FitNesseContext;
import fitnesse.http.Request;
import fitnesse.http.Response;
import fitnesse.html.template.HtmlPage;
import fitnesse.wiki.WikiPage;

public class DefaultResponder extends BasicResponder {

  @Override
  public Response makeResponse(FitNesseContext context, Request request) {
    return responseWith(contentFrom(context, request, null));
  }

  @Override
  protected String contentFrom(FitNesseContext context, Request request, WikiPage requestedPage) {
    return prepareResponseDocument(context).html();
  }

  private HtmlPage prepareResponseDocument(FitNesseContext context) {
    HtmlPage responseDocument = context.pageFactory.newPage();
    responseDocument.addTitles("Default Responder");
    responseDocument.setMainTemplate("defaultPage.vm");
    return responseDocument;
  }
}
TOP

Related Classes of fitnesse.responders.DefaultResponder

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.