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.*;
06: import fitnesse.http.*;
07:
08: public abstract class BasicResponder implements Responder {
09: protected Response pageNotFoundResponse(FitNesseContext context,
10: Request request) throws Exception {
11: return new NotFoundResponder().makeResponse(context, request);
12: }
13:
14: protected Response responseWith(String content) throws Exception {
15: SimpleResponse response = new SimpleResponse();
16: response.setContentType(getContentType());
17: response.setContent(content);
18: return response;
19: }
20:
21: protected String getContentType() {
22: return Response.DEFAULT_CONTENT_TYPE;
23: }
24: }
|