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

Method requestHandler

java/org/apache/catalina/ssi/SSIServlet.java:147–175  ·  view source on GitHub ↗

Process our request and locate right SSI command. @param req a value of type 'HttpServletRequest' @param res a value of type 'HttpServletResponse' @throws IOException an IO error occurred

(HttpServletRequest req, HttpServletResponse res)

Source from the content-addressed store, hash-verified

145 * @throws IOException an IO error occurred
146 */
147 protected void requestHandler(HttpServletRequest req, HttpServletResponse res) throws IOException {
148 ServletContext servletContext = getServletContext();
149 String path = SSIServletRequestUtil.getRelativePath(req);
150 if (debug > 0) {
151 log("SSIServlet.requestHandler()\n" + "Serving " + (buffered ? "buffered " : "unbuffered ") + "resource '" +
152 path + "'");
153 }
154 // Exclude any resource in the /WEB-INF and /META-INF subdirectories
155 // (the "toUpperCase()" avoids problems on Windows systems)
156 if (path == null || path.toUpperCase(Locale.ENGLISH).startsWith("/WEB-INF") ||
157 path.toUpperCase(Locale.ENGLISH).startsWith("/META-INF")) {
158 res.sendError(HttpServletResponse.SC_NOT_FOUND);
159 return;
160 }
161 URL resource = servletContext.getResource(path);
162 if (resource == null) {
163 res.sendError(HttpServletResponse.SC_NOT_FOUND);
164 return;
165 }
166 String resourceMimeType = servletContext.getMimeType(path);
167 if (resourceMimeType == null) {
168 resourceMimeType = "text/html";
169 }
170 res.setContentType(resourceMimeType + ";charset=" + outputEncoding);
171 if (expires != null) {
172 res.setDateHeader("Expires", (new java.util.Date()).getTime() + expires.longValue() * 1000);
173 }
174 processSSI(req, res, resource);
175 }
176
177
178 /**

Callers 2

doGetMethod · 0.95
doPostMethod · 0.95

Calls 11

getRelativePathMethod · 0.95
getResourceMethod · 0.95
getMimeTypeMethod · 0.95
processSSIMethod · 0.95
getServletContextMethod · 0.65
logMethod · 0.65
sendErrorMethod · 0.65
setContentTypeMethod · 0.65
setDateHeaderMethod · 0.65
startsWithMethod · 0.45
getTimeMethod · 0.45

Tested by

no test coverage detected