Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-dev] Case Insensitive URLs


I see that this can now be done by deriving from the ContextHandlerCollection.

public class CaseInsensitiveContextHandlerCollection extends ContextHandlerCollection {
    @Override
    public void handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
        super.handle(target.toLowerCase(), baseRequest, request, response);
    }
}

On Tue, Mar 26, 2013 at 1:07 PM, James Folmar <jamesfolmar@xxxxxxxxx> wrote:
Is there a technique in Jetty 8 that can be used to support case insensitive URLs? 
I am upgrading an embedded Jetty server from 6 to 8. In Jetty 6 I simply derived from Context as follows: 

public class CaseInsensitiveContext extends Context{
  @Override
    public void handle(String target, HttpServletRequest request, HttpServletResponse response, int dispatch) throws IOException, ServletException {
        super.handle(target.toLowerCase(), request, response, dispatch);
    }
}

Adding  this as the default context "/" would allow all urls of the same name but varying cases to be handled by the same handler. 




Back to the top