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


Java HttpServerExchange.getQueryString方法代码示例

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


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

示例1: readAttribute

import io.undertow.server.HttpServerExchange; //导入方法依赖的package包/类
@Override
public String readAttribute(final HttpServerExchange exchange) {
    String qs = exchange.getQueryString();
    if(qs.isEmpty()) {
        return qs;
    }
    return '?' + qs;
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:9,代码来源:QueryStringAttribute.java

示例2: getRedirectURI

import io.undertow.server.HttpServerExchange; //导入方法依赖的package包/类
protected URI getRedirectURI(HttpServerExchange exchange, int port) throws URISyntaxException {
    String host = exchange.getHostName();

    String queryString = exchange.getQueryString();
    return new URI("https", null, host, port, exchange.getRequestURI(),
            queryString == null || queryString.length() == 0 ? null : queryString, null);
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:8,代码来源:SinglePortConfidentialityHandler.java

示例3: logMessage

import io.undertow.server.HttpServerExchange; //导入方法依赖的package包/类
public void logMessage(String pattern, HttpServerExchange exchange) {
    JDBCLogAttribute jdbcLogAttribute = new JDBCLogAttribute();

    if (pattern.equals("combined")) {
        jdbcLogAttribute.pattern = pattern;
    }
    jdbcLogAttribute.remoteHost = ((InetSocketAddress) exchange.getConnection().getPeerAddress()).getAddress().getHostAddress();
    SecurityContext sc = exchange.getSecurityContext();
    if (sc == null || !sc.isAuthenticated()) {
        jdbcLogAttribute.user = null;
    } else {
        jdbcLogAttribute.user = sc.getAuthenticatedAccount().getPrincipal().getName();
    }
    jdbcLogAttribute.query = exchange.getQueryString();

    jdbcLogAttribute.bytes = exchange.getResponseContentLength();
    if (jdbcLogAttribute.bytes < 0)
        jdbcLogAttribute.bytes = 0;

    jdbcLogAttribute.status = exchange.getResponseCode();

    if (jdbcLogAttribute.pattern.equals("combined")) {
        jdbcLogAttribute.virtualHost = exchange.getRequestHeaders().getFirst(Headers.HOST);
        jdbcLogAttribute.method = exchange.getRequestMethod().toString();
        jdbcLogAttribute.referer = exchange.getRequestHeaders().getFirst(Headers.REFERER);
        jdbcLogAttribute.userAgent = exchange.getRequestHeaders().getFirst(Headers.USER_AGENT);
    }

    this.pendingMessages.add(jdbcLogAttribute);
    int state = stateUpdater.get(this);
    if (state == 0) {
        if (stateUpdater.compareAndSet(this, 0, 1)) {
            logWriteExecutor.execute(this);
        }
    }
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:37,代码来源:JDBCLogHandler.java


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