示例#1
0
  @Override
  public IRequestHandler mapRequest(final Request request) {
    Url url = decryptUrl(request, request.getUrl());

    if (url == null) {
      return null;
    }

    return wrappedMapper.mapRequest(request.cloneWithUrl(url));
  }
示例#2
0
  @Override
  public IRequestHandler mapRequest(Request request) {
    IRequestHandler handler = delegate.mapRequest(request);

    Scheme desired = getDesiredSchemeFor(handler);
    Scheme current = getSchemeOf(request);
    if (!desired.isCompatibleWith(current)) {
      // we are currently on the wrong scheme for this handler

      // construct a url for the handler on the correct scheme
      String url = createRedirectUrl(handler, request, desired);

      // replace handler with one that will redirect to the created url
      handler = createRedirectHandler(url);
    }
    return handler;
  }
示例#3
0
 /**
  * Resolves current request to a {@link IRequestHandler}.
  *
  * @return RequestHandler instance
  */
 protected IRequestHandler resolveRequestHandler() {
   return requestMapper.mapRequest(request);
 }