本文整理了Java中org.eclipse.jetty.server.Request.getRemoteHost
方法的一些代码示例,展示了Request.getRemoteHost
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Request.getRemoteHost
方法的具体详情如下:
包路径:org.eclipse.jetty.server.Request
类名称:Request
方法名:getRemoteHost
暂无
代码示例来源:origin: jphp-group/jphp
@Signature
public String remoteHost() {
return request.getRemoteHost();
}
代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-all-server
@Override
public String getRemoteHost()
{
if (_remoteHost != null)
return _remoteHost;
if (_remoteAddr != null)
return _remoteAddr;
return super.getRemoteHost();
}
代码示例来源:origin: bozaro/git-as-svn
public WebServer(@NotNull SharedContext context, @Nullable Server server, @NotNull WebServerConfig config, @NotNull EncryptionFactory tokenFactory) {
this.context = context;
this.server = server;
this.config = config;
this.tokenFactory = tokenFactory;
if (server != null) {
final ServletContextHandler contextHandler = new ServletContextHandler();
contextHandler.setContextPath("/");
handler = contextHandler.getServletHandler();
final RequestLogHandler logHandler = new RequestLogHandler();
logHandler.setRequestLog((request, response) -> {
final User user = (User) request.getAttribute(User.class.getName());
final String userName = (user == null || user.isAnonymous()) ? "" : user.getUserName();
log.info("{}:{} - {} - \"{} {}\" {} {}", request.getRemoteHost(), request.getRemotePort(), userName, request.getMethod(), request.getHttpURI(), response.getStatus(), response.getReason());
});
final HandlerCollection handlers = new HandlerCollection();
handlers.addHandler(contextHandler);
handlers.addHandler(logHandler);
server.setHandler(handlers);
} else {
handler = null;
}
}
代码示例来源:origin: jenkinsci/winstone
{"###dnt###", nvl(request.getHeader("DNT"))},
{"###via###", nvl(request.getHeader("Via"))},
{"###ip###", request.getRemoteHost()},
{"###user###", nvl(remoteUser)},
{"###time###", "[" + date + "]"},
内容来源于网络,如有侵权,请联系作者删除!