MCPcopy Index your code
hub / github.com/apache/tomcat / doGet

Method doGet

webapps/docs/appdev/sample/src/mypackage/Hello.java:49–78  ·  view source on GitHub ↗

Respond to a GET request for the content produced by this servlet. @param request The servlet request we are processing @param response The servlet response we are producing @exception IOException if an input/output error occurs @exception ServletException if a servlet error occurs

(HttpServletRequest request,
                      HttpServletResponse response)

Source from the content-addressed store, hash-verified

47 * @exception ServletException if a servlet error occurs
48 */
49 @Override
50 public void doGet(HttpServletRequest request,
51 HttpServletResponse response)
52 throws IOException, ServletException {
53
54 response.setContentType("text/html");
55 response.setCharacterEncoding("UTF-8");
56 try (PrintWriter writer = response.getWriter()) {
57
58 writer.println("<!DOCTYPE html><html>");
59 writer.println("<head>");
60 writer.println("<meta charset=\"UTF-8\" />");
61 writer.println("<title>Sample Application Servlet Page</title>");
62 writer.println("</head>");
63 writer.println("<body>");
64
65
66 writer.println("<div style=\"float: left; padding: 10px;\">");
67 writer.println("<img src=\"images/tomcat.gif\" alt=\"\" />");
68 writer.println("</div>");
69 writer.println("<h1>Sample Application Servlet</h1>");
70 writer.println("<p>");
71 writer.println("This is the output of a servlet that is part of");
72 writer.println("the Hello, World application.");
73 writer.println("</p>");
74
75 writer.println("</body>");
76 writer.println("</html>");
77 }
78 }
79
80
81}

Callers

nothing calls this directly

Calls 4

setContentTypeMethod · 0.65
setCharacterEncodingMethod · 0.65
getWriterMethod · 0.65
printlnMethod · 0.45

Tested by

no test coverage detected