comparison src/org/eclipse/jetty/server/handler/DefaultHandler.java @ 1000:32d4b569567c

simplify handle()
author Franklin Schmidt <fschmidt@gmail.com>
date Wed, 19 Oct 2016 04:22:51 -0600
parents 688c39c50ee3
children 3718afd99988
comparison
equal deleted inserted replaced
999:74b9daf2826c 1000:32d4b569567c
21 import java.io.IOException; 21 import java.io.IOException;
22 import java.io.OutputStream; 22 import java.io.OutputStream;
23 import java.net.URL; 23 import java.net.URL;
24 24
25 import javax.servlet.ServletException; 25 import javax.servlet.ServletException;
26 import javax.servlet.http.HttpServletRequest;
27 import javax.servlet.http.HttpServletResponse; 26 import javax.servlet.http.HttpServletResponse;
28 27
29 import org.eclipse.jetty.http.HttpHeaders; 28 import org.eclipse.jetty.http.HttpHeaders;
30 import org.eclipse.jetty.http.HttpMethods; 29 import org.eclipse.jetty.http.HttpMethods;
31 import org.eclipse.jetty.http.MimeTypes; 30 import org.eclipse.jetty.http.MimeTypes;
55 { 54 {
56 private static final Logger LOG = LoggerFactory.getLogger(DefaultHandler.class); 55 private static final Logger LOG = LoggerFactory.getLogger(DefaultHandler.class);
57 56
58 boolean _showContexts=true; 57 boolean _showContexts=true;
59 58
60 /* ------------------------------------------------------------ */ 59 @Override
61 /* 60 public void handle(String target, Request request, HttpServletResponse response) throws IOException, ServletException
62 * @see org.eclipse.jetty.server.server.Handler#handle(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, int)
63 */
64 public void handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException
65 { 61 {
66 if (response.isCommitted() || baseRequest.isHandled()) 62 if (response.isCommitted() || request.isHandled())
67 return; 63 return;
68 64
69 baseRequest.setHandled(true); 65 request.setHandled(true);
70 66
71 String method=request.getMethod(); 67 String method=request.getMethod();
72 68
73 if (!method.equals(HttpMethods.GET) || !request.getRequestURI().equals("/")) 69 if (!method.equals(HttpMethods.GET) || !request.getRequestURI().equals("/"))
74 { 70 {