X-Git-Url: https://code.wpia.club/?p=gigi.git;a=blobdiff_plain;f=lib%2Fjetty%2Forg%2Feclipse%2Fjetty%2Fservlet%2FJspPropertyGroupServlet.java;h=aa14e2c3dd2d23bba2c14490e8e1a5ab39541eb7;hp=d0fcbfe1c7b34f2af1730137c9baa5e818c44c69;hb=ba4f228fa9f72d50991a2218cfd83987ef5d385e;hpb=875b5e9651498a0cd8e0001c0742ba843e47cad0 diff --git a/lib/jetty/org/eclipse/jetty/servlet/JspPropertyGroupServlet.java b/lib/jetty/org/eclipse/jetty/servlet/JspPropertyGroupServlet.java index d0fcbfe1..aa14e2c3 100644 --- a/lib/jetty/org/eclipse/jetty/servlet/JspPropertyGroupServlet.java +++ b/lib/jetty/org/eclipse/jetty/servlet/JspPropertyGroupServlet.java @@ -1,6 +1,6 @@ // // ======================================================================== -// Copyright (c) 1995-2014 Mort Bay Consulting Pty. Ltd. +// Copyright (c) 1995-2016 Mort Bay Consulting Pty. Ltd. // ------------------------------------------------------------------------ // All rights reserved. This program and the accompanying materials // are made available under the terms of the Eclipse Public License v1.0 @@ -19,6 +19,7 @@ package org.eclipse.jetty.servlet; import java.io.IOException; +import java.util.Locale; import javax.servlet.GenericServlet; import javax.servlet.ServletException; @@ -35,37 +36,37 @@ import org.eclipse.jetty.util.resource.Resource; /* ------------------------------------------------------------ */ /** Servlet handling JSP Property Group mappings *

- * This servlet is mapped to by any URL pattern for a JSP property group. + * This servlet is mapped to by any URL pattern for a JSP property group. * Resources handled by this servlet that are not directories will be passed - * directly to the JSP servlet. Resources that are directories will be + * directly to the JSP servlet. Resources that are directories will be * passed directly to the default servlet. */ public class JspPropertyGroupServlet extends GenericServlet { private static final long serialVersionUID = 3681783214726776945L; - + public final static String NAME = "__org.eclipse.jetty.servlet.JspPropertyGroupServlet__"; private final ServletHandler _servletHandler; private final ContextHandler _contextHandler; private ServletHolder _dftServlet; private ServletHolder _jspServlet; private boolean _starJspMapped; - + public JspPropertyGroupServlet(ContextHandler context, ServletHandler servletHandler) { _contextHandler=context; - _servletHandler=servletHandler; + _servletHandler=servletHandler; } - + @Override public void init() throws ServletException - { + { String jsp_name = "jsp"; ServletMapping servlet_mapping =_servletHandler.getServletMapping("*.jsp"); if (servlet_mapping!=null) { _starJspMapped=true; - + //now find the jsp servlet, ignoring the mapping that is for ourself ServletMapping[] mappings = _servletHandler.getServletMappings(); for (ServletMapping m:mappings) @@ -80,11 +81,11 @@ public class JspPropertyGroupServlet extends GenericServlet } } } - + jsp_name=servlet_mapping.getServletName(); } _jspServlet=_servletHandler.getServlet(jsp_name); - + String dft_name="default"; ServletMapping default_mapping=_servletHandler.getServletMapping("/"); if (default_mapping!=null) @@ -94,7 +95,7 @@ public class JspPropertyGroupServlet extends GenericServlet @Override public void service(ServletRequest req, ServletResponse res) throws ServletException, IOException - { + { HttpServletRequest request = null; if (req instanceof HttpServletRequest) request = (HttpServletRequest)req; @@ -118,27 +119,27 @@ public class JspPropertyGroupServlet extends GenericServlet servletPath = request.getServletPath(); pathInfo = request.getPathInfo(); } - + String pathInContext=URIUtil.addPaths(servletPath,pathInfo); - + if (pathInContext.endsWith("/")) { _dftServlet.getServlet().service(req,res); } - else if (_starJspMapped && pathInContext.toLowerCase().endsWith(".jsp")) + else if (_starJspMapped && pathInContext.toLowerCase(Locale.ENGLISH).endsWith(".jsp")) { _jspServlet.getServlet().service(req,res); } else { - + Resource resource = _contextHandler.getResource(pathInContext); if (resource!=null && resource.isDirectory()) _dftServlet.getServlet().service(req,res); else _jspServlet.getServlet().service(req,res); } - + } }