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; }
protected Response doMakeResponse( FitNesseContext context, Request request, boolean firstTimeForNewPage) throws Exception { initializeResponder(context.root, request); SimpleResponse response = new SimpleResponse(); String resource = request.getResource(); WikiPagePath path = PathParser.parse(resource); PageCrawler crawler = context.root.getPageCrawler(); if (!crawler.pageExists(root, path)) { crawler.setDeadEndStrategy(new MockingPageCrawler()); page = crawler.getPage(root, path); } else page = crawler.getPage(root, path); pageData = page.getData(); content = createPageContent(); String html = doMakeHtml(resource, context, firstTimeForNewPage); response.setContent(html); response.setMaxAge(0); return response; }