MCPcopy Create free account
hub / github.com/apache/tomcat / doGet

Method doGet

java/org/apache/catalina/servlets/CGIServlet.java:554–580  ·  view source on GitHub ↗

Provides CGI Gateway service. @param req HttpServletRequest passed in by servlet container @param res HttpServletResponse passed in by servlet container @exception ServletException if a servlet-specific exception occurs @exception IOException if a read/write exception occurs

(HttpServletRequest req, HttpServletResponse res)

Source from the content-addressed store, hash-verified

552 * @exception IOException if a read/write exception occurs
553 */
554 @Override
555 protected void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException {
556
557 CGIEnvironment cgiEnv = new CGIEnvironment(req, getServletContext());
558
559 if (cgiEnv.isValid()) {
560 CGIRunner cgi = new CGIRunner(cgiEnv.getCommand(), cgiEnv.getEnvironment(), cgiEnv.getWorkingDirectory(),
561 cgiEnv.getParameters());
562
563 if (Method.POST.equals(req.getMethod())) {
564 cgi.setInput(req.getInputStream());
565 }
566 cgi.setResponse(res);
567 cgi.run();
568 } else {
569 res.sendError(404);
570 }
571
572 if (log.isTraceEnabled()) {
573 String[] cgiEnvLines = cgiEnv.toString().split(System.lineSeparator());
574 for (String cgiEnvLine : cgiEnvLines) {
575 log.trace(cgiEnvLine);
576 }
577
578 printServletEnvironment(req);
579 }
580 }
581
582
583 @Override

Callers 2

serviceMethod · 0.95
serviceMethod · 0.45

Calls 15

isValidMethod · 0.95
getCommandMethod · 0.95
getEnvironmentMethod · 0.95
getWorkingDirectoryMethod · 0.95
getParametersMethod · 0.95
setInputMethod · 0.95
setResponseMethod · 0.95
runMethod · 0.95
toStringMethod · 0.95
getServletContextMethod · 0.65
equalsMethod · 0.65

Tested by

no test coverage detected