01: // Copyright (C) 2003,2004,2005 by Object Mentor, Inc. All rights reserved.
02: // Released under the terms of the GNU General Public License version 2 or later.
03: package fitnesse.responders;
04:
05: import fitnesse.http.*;
06: import fitnesse.*;
07: import fitnesse.html.*;
08:
09: public class DefaultResponder extends BasicResponder {
10: public Response makeResponse(FitNesseContext context,
11: Request request) throws Exception {
12: String content = prepareResponseDocument(context).html();
13: return responseWith(content);
14: }
15:
16: private HtmlPage prepareResponseDocument(FitNesseContext context) {
17: HtmlPage responseDocument = context.htmlPageFactory.newPage();
18: HtmlUtil.addTitles(responseDocument, "Default Responder");
19: responseDocument.main.use(content());
20: return responseDocument;
21: }
22:
23: private String content() {
24: StringBuffer buffer = new StringBuffer();
25: buffer.append("This is the DefaultResponder page.<br>");
26: buffer
27: .append("Because you can see this page something has gone wrong.<br>");
28: buffer
29: .append("If you continue to get this page, please let us know how.<br>");
30: buffer.append("Thanks,<br>");
31: buffer
32: .append("<ul><li><a href=\"mailto:micah@objectmentor.com\">The FitNesse development team.</a></ul>");
33: return buffer.toString();
34: }
35:
36: }
|