Mercurial Hosting > luan
comparison src/org/eclipse/jetty/server/handler/ContextHandler.java @ 822:0048a843297a
remove Dispatcher
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Wed, 14 Sep 2016 00:58:52 -0600 |
parents | 8e9db0bbf4f9 |
children | 8579194add85 |
comparison
equal
deleted
inserted
replaced
821:292f2e31ab41 | 822:0048a843297a |
---|---|
63 | 63 |
64 import org.eclipse.jetty.http.HttpException; | 64 import org.eclipse.jetty.http.HttpException; |
65 import org.eclipse.jetty.http.MimeTypes; | 65 import org.eclipse.jetty.http.MimeTypes; |
66 import org.eclipse.jetty.io.Buffer; | 66 import org.eclipse.jetty.io.Buffer; |
67 import org.eclipse.jetty.server.AbstractHttpConnection; | 67 import org.eclipse.jetty.server.AbstractHttpConnection; |
68 import org.eclipse.jetty.server.Dispatcher; | |
69 import org.eclipse.jetty.server.Handler; | 68 import org.eclipse.jetty.server.Handler; |
70 import org.eclipse.jetty.server.HandlerContainer; | 69 import org.eclipse.jetty.server.HandlerContainer; |
71 import org.eclipse.jetty.server.Request; | 70 import org.eclipse.jetty.server.Request; |
72 import org.eclipse.jetty.server.Server; | 71 import org.eclipse.jetty.server.Server; |
73 import org.eclipse.jetty.util.Attributes; | 72 import org.eclipse.jetty.util.Attributes; |
1868 * @see javax.servlet.ServletContext#getRequestDispatcher(java.lang.String) | 1867 * @see javax.servlet.ServletContext#getRequestDispatcher(java.lang.String) |
1869 */ | 1868 */ |
1870 @Override | 1869 @Override |
1871 public RequestDispatcher getRequestDispatcher(String uriInContext) | 1870 public RequestDispatcher getRequestDispatcher(String uriInContext) |
1872 { | 1871 { |
1873 if (uriInContext == null) | 1872 throw new UnsupportedOperationException(); |
1874 return null; | |
1875 | |
1876 if (!uriInContext.startsWith("/")) | |
1877 return null; | |
1878 | |
1879 try | |
1880 { | |
1881 String query = null; | |
1882 int q = 0; | |
1883 if ((q = uriInContext.indexOf('?')) > 0) | |
1884 { | |
1885 query = uriInContext.substring(q + 1); | |
1886 uriInContext = uriInContext.substring(0,q); | |
1887 } | |
1888 | |
1889 String pathInContext = URIUtil.canonicalPath(URIUtil.decodePath(uriInContext)); | |
1890 if (pathInContext!=null) | |
1891 { | |
1892 String uri = URIUtil.addPaths(getContextPath(),uriInContext); | |
1893 ContextHandler context = ContextHandler.this; | |
1894 return new Dispatcher(context,uri,pathInContext,query); | |
1895 } | |
1896 } | |
1897 catch (Exception e) | |
1898 { | |
1899 LOG.trace("",e); | |
1900 } | |
1901 return null; | |
1902 } | 1873 } |
1903 | 1874 |
1904 /* ------------------------------------------------------------ */ | 1875 /* ------------------------------------------------------------ */ |
1905 /* | 1876 /* |
1906 * @see javax.servlet.ServletContext#getRealPath(java.lang.String) | 1877 * @see javax.servlet.ServletContext#getRealPath(java.lang.String) |