当前位置: 首页>>代码示例>>Java>>正文


Java ResponseCodeHandler类代码示例

本文整理汇总了Java中io.undertow.server.handlers.ResponseCodeHandler的典型用法代码示例。如果您正苦于以下问题:Java ResponseCodeHandler类的具体用法?Java ResponseCodeHandler怎么用?Java ResponseCodeHandler使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ResponseCodeHandler类属于io.undertow.server.handlers包,在下文中一共展示了ResponseCodeHandler类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: handleRequest

import io.undertow.server.handlers.ResponseCodeHandler; //导入依赖的package包/类
@Override
public void handleRequest(HttpServerExchange exchange) throws Exception {
    if (Methods.POST.equals(exchange.getRequestMethod()))  {
        ResponseCodeHandler.HANDLE_405.handleRequest(exchange);
        return;
    }
    String origReqPath = exchange.getRelativePath();
    String remapped = remapper.remapPath(origReqPath);
    if (remapped == null) {
        ResponseCodeHandler.HANDLE_404.handleRequest(exchange);
        return;
    }
    exchange.setRelativePath(remapped);

    // Note: we only change the relative path, not other exchange data that
    // incorporates it (like getRequestPath(), getRequestURL()) and not the
    // resolved path. If this request gets to DomainApiHandler, it should
    // work off the relative path. Other handlers in between may need the
    // original data.

    next.handleRequest(exchange);
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:23,代码来源:ManagementHttpServer.java

示例2: build

import io.undertow.server.handlers.ResponseCodeHandler; //导入依赖的package包/类
@Override
public HandlerWrapper build(final Map<String, Object> config) {
    final Integer value = (Integer) config.get("value");
    return new HandlerWrapper() {
        @Override
        public HttpHandler wrap(HttpHandler handler) {
            return new ResponseCodeHandler(value);
        }
    };
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:11,代码来源:ResponseCodeHandlerBuilder.java

示例3: proxyHandler

import io.undertow.server.handlers.ResponseCodeHandler; //导入依赖的package包/类
/**
 * Returns a handler that can act as a load balancing reverse proxy.
 *
 * @param proxyClient The proxy client to use to connect to the remote server
 * @return The proxy handler
 */
public static ProxyHandler proxyHandler(ProxyClient proxyClient) {
    return new ProxyHandler(proxyClient, ResponseCodeHandler.HANDLE_404);
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:10,代码来源:Handlers.java

示例4: WebSocketProtocolHandshakeHandler

import io.undertow.server.handlers.ResponseCodeHandler; //导入依赖的package包/类
/**
 * Create a new {@link WebSocketProtocolHandshakeHandler}
 *
 * @param callback The {@link WebSocketConnectionCallback} which will be executed once the handshake was
 *                 established
 */
public WebSocketProtocolHandshakeHandler(final WebSocketConnectionCallback callback) {
    this(callback, ResponseCodeHandler.HANDLE_404);
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:10,代码来源:WebSocketProtocolHandshakeHandler.java


注:本文中的io.undertow.server.handlers.ResponseCodeHandler类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。