예제 #1
0
  public Response makeResponse(FitNesseContext context, Request request) {
    response = new SimpleResponse();
    resource = request.getResource();
    path = PathParser.parse(resource);
    PageCrawler crawler = context.root.getPageCrawler();
    page = crawler.getPage(path, new MockingPageCrawler());
    if (page == null) return new NotFoundResponder().makeResponse(context, request);

    pageData = page.getData();
    makeContent(context, request);
    response.setMaxAge(0);
    return response;
  }
  public Response makeResponse(FitNesseContext context, Request request) throws Exception {
    response = new SimpleResponse();
    resource = request.getResource();
    path = PathParser.parse(resource);
    PageCrawler crawler = context.root.getPageCrawler();
    if (!crawler.pageExists(context.root, path))
      crawler.setDeadEndStrategy(new MockingPageCrawler());
    page = crawler.getPage(context.root, path);
    if (page == null) return new NotFoundResponder().makeResponse(context, request);

    pageData = page.getData();
    makeContent(context, request);
    response.setMaxAge(0);
    return response;
  }