1 package dolda.jsvc.test;
6 public class TestResponder implements Responder {
7 public void respond(Request req) {
8 req.outheaders().put("Content-Type", "text/html; charset=utf-8");
11 out = new PrintWriter(new OutputStreamWriter(req.output(), "UTF-8"));
12 } catch(UnsupportedEncodingException e) {
16 if(req.path().equals("bard1"))
17 throw(new RuntimeException("bard1"));
19 out.println("<html>");
20 out.println("<head><title>Barda</title></head>");
21 out.println("<body>");
22 out.println("<h1>Barda</h1>");
23 out.println("Bardslen.");
24 out.println(req.inheaders());
25 out.println(req.ctx().starttime());
26 out.println(req.remoteaddr() + "<->" + req.localaddr());
27 out.println("</body>");
28 out.println("</html>");
30 if(req.path().equals("bard2"))
31 throw(new RuntimeException("bard2"));