protected void doGet()

in src/main/java/org/apache/sling/launchpad/testservices/servlets/PlanetResourceRenderingServlet.java [46:60]


    protected void doGet(SlingHttpServletRequest request, SlingHttpServletResponse response) 
    throws ServletException, IOException {
        response.setContentType("text/html");
        response.setCharacterEncoding("UTF-8");
        
        final ValueMap properties = request.getResource().adaptTo(ValueMap.class);
        
        // TODO should escape output - good enough for our tests 
        final PrintWriter pw = response.getWriter();
        pw.println(String.format("<html><head><title>Planet at %s</title></head><body>", request.getResource().getPath()));
        pw.println(String.format("<p>Name: %s</p>", properties.get("name")));
        pw.println(String.format("<p>Distance: %s</p>", properties.get("distance")));
        pw.println("</body></html>");
        pw.flush();
    }