本文整理了Java中org.eclipse.jetty.server.Request.getAttribute
方法的一些代码示例,展示了Request.getAttribute
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Request.getAttribute
方法的具体详情如下:
包路径:org.eclipse.jetty.server.Request
类名称:Request
方法名:getAttribute
[英]Get Request Attribute.
Also supports jetty specific attributes to gain access to Jetty APIs: org.eclipse.jetty.server.ServerThe Jetty Server instance org.eclipse.jetty.server.HttpChannelThe HttpChannel for this request org.eclipse.jetty.server.HttpConnectionThe HttpConnection or null if another transport is used While these attributes may look like security problems, they are exposing nothing that is not already available via reflection from a Request instance.
[中]获取请求属性。
还支持jetty特定属性,以访问jetty API:org。日食码头。服务器服务器Jetty服务器实例组织。日食码头。服务器HttpChannel此请求组织的HttpChannel。日食码头。服务器HttpConnection HttpConnection或null如果使用了另一个传输,虽然这些属性看起来像是安全问题,但它们不会暴露任何通过请求实例的反射尚不可用的内容。
代码示例来源:origin: jphp-group/jphp
@Signature
public Object attribute(String name) {
return request.getAttribute(name);
}
代码示例来源:origin: jphp-group/jphp
@Override
public Resource getResource(String path) {
if (!once[0]) {
once[0] = true;
Object attr = request.getRequest().getAttribute("**");
File file;
if (attr != null) {
file = new File(PHttpResourceHandler.this.file, "/" + attr);
} else {
file = new File(PHttpResourceHandler.this.file);
}
if (file.exists()) {
return new PathResource(file.getAbsoluteFile());
} else {
return null;
}
} else {
return null;
}
}
};
代码示例来源:origin: org.eclipse.jetty/jetty-security
protected boolean checkSecurity(Request request)
{
switch(request.getDispatcherType())
{
case REQUEST:
case ASYNC:
return true;
case FORWARD:
if (isCheckWelcomeFiles() && request.getAttribute("org.eclipse.jetty.server.welcome") != null)
{
request.removeAttribute("org.eclipse.jetty.server.welcome");
return true;
}
return false;
default:
return false;
}
}
代码示例来源:origin: org.keycloak/keycloak-jetty-core
@Override
public KeycloakSecurityContext getSecurityContext() {
return (KeycloakSecurityContext)request.getAttribute(KeycloakSecurityContext.class.getName());
}
代码示例来源:origin: io.airlift/http-server
@SuppressWarnings("unchecked")
@Override
public void onResponseContent(Request request, ByteBuffer content)
{
List<Long> contentTimestamps = (List<Long>) request.getAttribute(RESPONSE_CONTENT_TIMESTAMPS_ATTRIBUTE);
contentTimestamps.add(System.nanoTime());
}
代码示例来源:origin: com.proofpoint.platform/http-server
@SuppressWarnings("unchecked")
@Override
public void onResponseContent(Request request, ByteBuffer content)
{
List<Long> contentTimestamps = (List<Long>) request.getAttribute(RESPONSE_CONTENT_TIMESTAMPS_ATTRIBUTE);
contentTimestamps.add(System.nanoTime());
}
代码示例来源:origin: io.airlift/http-server
@SuppressWarnings("unchecked")
@Override
public void onRequestEnd(Request request)
{
long requestBeginTime = (Long) request.getAttribute(REQUEST_BEGIN_ATTRIBUTE);
request.setAttribute(REQUEST_BEGIN_TO_END_ATTRIBUTE, System.nanoTime() - requestBeginTime);
}
代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-webapp
/**
* @see org.eclipse.jetty.continuation.Continuation#getAttribute(java.lang.String)
*/
public Object getAttribute(String name)
{
return _connection.getRequest().getAttribute(name);
}
代码示例来源:origin: com.proofpoint.platform/http-server
@SuppressWarnings("unchecked")
@Override
public void onRequestEnd(Request request)
{
long requestBeginTime = (Long) request.getAttribute(REQUEST_BEGIN_ATTRIBUTE);
request.setAttribute(REQUEST_BEGIN_TO_END_ATTRIBUTE, System.nanoTime() - requestBeginTime);
}
代码示例来源:origin: at.bestsolution.efxclipse.eclipse/org.eclipse.jetty.server
public Object getAttribute(String name)
{
return _channel.getRequest().getAttribute(name);
}
代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-all-server
/**
* @see org.eclipse.jetty.continuation.Continuation#getAttribute(java.lang.String)
*/
public Object getAttribute(String name)
{
return _connection.getRequest().getAttribute(name);
}
代码示例来源:origin: Nextdoor/bender
public Object getAttribute(String name)
{
return _channel.getRequest().getAttribute(name);
}
代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-server
/**
* @see org.eclipse.jetty.continuation.Continuation#getAttribute(java.lang.String)
*/
public Object getAttribute(String name)
{
return _connection.getRequest().getAttribute(name);
}
代码示例来源:origin: org.eclipse.jetty/server
/**
* @see org.eclipse.jetty.continuation.Continuation#getAttribute(java.lang.String)
*/
public Object getAttribute(String name)
{
return _connection.getRequest().getAttribute(name);
}
代码示例来源:origin: io.airlift/http-server
@SuppressWarnings("unchecked")
@Override
public void onBeforeDispatch(Request request)
{
long requestBeginTime = (Long) request.getAttribute(REQUEST_BEGIN_ATTRIBUTE);
request.setAttribute(REQUEST_BEGIN_TO_DISPATCH_ATTRIBUTE, System.nanoTime() - requestBeginTime);
}
代码示例来源:origin: org.restlet.jee/org.restlet.ext.jetty
@Override
public String getSslCipherSuite() {
return (String) getConnection().getRequest().getAttribute(
"javax.servlet.request.cipher_suite");
}
代码示例来源:origin: com.yahoo.athenz/athenz-jetty-container
private void logRequestUri(StringBuilder buf, Request request) {
final Object skipQuery = request.getAttribute(REQUEST_URI_SKIP_QUERY);
append(buf, (skipQuery == Boolean.TRUE) ? request.getRequestURI() : request.getOriginalURI());
}
代码示例来源:origin: org.restlet.jee/org.restlet.ext.jetty
@Override
public Integer getSslKeySize() {
Integer keySize = (Integer) getConnection().getRequest().getAttribute(
"javax.servlet.request.key_size");
if (keySize == null) {
keySize = super.getSslKeySize();
}
return keySize;
}
代码示例来源:origin: org.keycloak/spring-boot-container-bundle
public AdapterTokenStore getTokenStore(Request request, HttpFacade facade, KeycloakDeployment resolvedDeployment) {
AdapterTokenStore store = (AdapterTokenStore) request.getAttribute(TOKEN_STORE_NOTE);
if (store != null) {
return store;
}
if (resolvedDeployment.getTokenStore() == TokenStore.SESSION) {
store = createSessionTokenStore(request, resolvedDeployment);
} else {
store = new JettyCookieTokenStore(request, facade, resolvedDeployment);
}
request.setAttribute(TOKEN_STORE_NOTE, store);
return store;
}
代码示例来源:origin: com.proofpoint.platform/http-server
@Override
public void log(Request request, Response response)
{
Duration requestTime = new Duration(max(0, System.currentTimeMillis() - request.getTimeStamp()), TimeUnit.MILLISECONDS);
SSLSession sslSession = (SSLSession) request.getAttribute(REQUEST_SSL_SESSION_ATTRIBUTE);
stats.record(request.getContentRead(), response.getContentCount(), requestTime);
detailedRequestStats.requestTimeByCode(response.getStatus(), response.getStatus() / 100).add(requestTime);
if (sslSession != null) {
detailedRequestStats.tlsRequest(sslSession.getProtocol(), sslSession.getCipherSuite()).add(1);
}
}
}
内容来源于网络,如有侵权,请联系作者删除!