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


Java HttpServerExchange.getRelativePath方法代码示例

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


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

示例1: handleRequest

import io.undertow.server.HttpServerExchange; //导入方法依赖的package包/类
@Override
public void handleRequest(final HttpServerExchange exchange) throws Exception {
    final String path = exchange.getRelativePath();
    SecurityPathMatch securityMatch = securityPathMatches.getSecurityInfo(path, exchange.getRequestMethod().toString());
    final ServletRequestContext servletRequestContext = exchange.getAttachment(ServletRequestContext.ATTACHMENT_KEY);
    List<SingleConstraintMatch> list = servletRequestContext.getRequiredConstrains();
    if (list == null) {
        servletRequestContext.setRequiredConstrains(list = new ArrayList<>());
    }
    list.add(securityMatch.getMergedConstraint());
    TransportGuaranteeType type = servletRequestContext.getTransportGuarenteeType();
    if (type == null || type.ordinal() < securityMatch.getTransportGuaranteeType().ordinal()) {
        servletRequestContext.setTransportGuarenteeType(securityMatch.getTransportGuaranteeType());
    }
    next.handleRequest(exchange);
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:17,代码来源:ServletSecurityConstraintHandler.java

示例2: resolve

import io.undertow.server.HttpServerExchange; //导入方法依赖的package包/类
@Override
public boolean resolve(final HttpServerExchange value) {
    final String relativePath = value.getRelativePath();
    PathMatcher.PathMatch<Boolean> result = pathMatcher.match(relativePath);

    boolean matches = result.getValue() == Boolean.TRUE;
    if(matches) {
        Map<String, Object> context = value.getAttachment(PREDICATE_CONTEXT);
        if(context != null) {
            context.put("remaining", result.getRemaining());
        }
    }
    return matches;
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:15,代码来源:PathPrefixPredicate.java

示例3: resolve

import io.undertow.server.HttpServerExchange; //导入方法依赖的package包/类
@Override
public boolean resolve(final HttpServerExchange value) {
    final String relativePath = value.getRelativePath();
    PathMatcher.PathMatch<Boolean> result = pathMatcher.match(relativePath);
    return result.getValue() == Boolean.TRUE;
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:7,代码来源:PathMatchPredicate.java

示例4: readAttribute

import io.undertow.server.HttpServerExchange; //导入方法依赖的package包/类
@Override
public String readAttribute(final HttpServerExchange exchange) {
    return exchange.getRelativePath();
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:5,代码来源:RelativePathAttribute.java


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