本文整理汇总了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);
}
示例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;
}
示例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;
}
示例4: readAttribute
import io.undertow.server.HttpServerExchange; //导入方法依赖的package包/类
@Override
public String readAttribute(final HttpServerExchange exchange) {
return exchange.getRelativePath();
}