Looking at having the following:

public class ContextPlay {
  public static void main(String[] args) throws Exception {
    Server server = new Server(8000);

    ContextHandlerCollection chc = new ContextHandlerCollection();
    chc.setHandlers(new Handler[] {new PrintHandler("/a"), new
PrintHandler("/b"), new PrintHandler("/c")});

    ContextHandler ch = new ContextHandler("/base")
    ch.setHandler(chc);

    server.setHandler(ch);

    server.start();
    server.join();
  }

  public static class PrintHandler extends ContextHandler {
    public PrintHandler(String context) {
      super(context);
    }

    @Override
    public void doHandle(String target, Request baseRequest,
HttpServletRequest request,
        HttpServletResponse response) throws IOException, ServletException {
      response.getWriter().print(getContextPath());
      baseRequest.setHandled(true);
    }
  }
}

So a base ContextHandler with the ContextHandlerCollection as
the ContextHandler's child handler.

A request to http://localhost:8000/base/c will 404, a request to
http://localhost:8000/base/a will succeed. Is this sort of chaining meant
to be supported by Jetty? It would certainly be useful.

Thanks, Neil
_______________________________________________
jetty-users mailing list
[email protected]
To change your delivery options, retrieve your password, or unsubscribe from 
this list, visit
https://dev.eclipse.org/mailman/listinfo/jetty-users

Reply via email to