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."
26: + HtmlUtil.BR);
27: buffer
28: .append("Because you can see this page something has gone wrong."
29: + HtmlUtil.BR);
30: buffer
31: .append("If you continue to get this page, please let us know how."
32: + HtmlUtil.BR);
33: buffer.append("Thanks," + HtmlUtil.BR);
34: buffer
35: .append("<ul><li><a href=\"mailto:micah@objectmentor.com\">The FitNesse development team.</a></ul>");
36: return buffer.toString();
37: }
38:
39: }
|