- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中com.jetdrone.vertx.yoke.middleware.YokeRequest.response()
方法的一些代码示例,展示了YokeRequest.response()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YokeRequest.response()
方法的具体详情如下:
包路径:com.jetdrone.vertx.yoke.middleware.YokeRequest
类名称:YokeRequest
方法名:response
暂无
代码示例来源:origin: pmlopes/yoke
@Override
public void handle(YokeRequest request) {
request.response().end(new JsonObject().put("name", "Tobi").put("role", "admin"));
}
})
代码示例来源:origin: pmlopes/yoke
XhrStreamingListener(int maxBytesStreaming, YokeRequest rc, SockJSSession session) {
super(rc, session);
this.maxBytesStreaming = maxBytesStreaming;
addCloseHandler(rc.response(), session);
}
代码示例来源:origin: pmlopes/yoke
@Override
public void handle(@NotNull YokeRequest request, @NotNull Handler<Object> next) {
request.response().putHeader("X-FRAME-OPTIONS", header);
next.handle(null);
}
}
代码示例来源:origin: pmlopes/yoke
@Override
public void handle(YokeRequest request) {
request.response().end("Hello World\n");
}
})
代码示例来源:origin: pmlopes/yoke
@Override
public void handle(@NotNull YokeRequest request, @NotNull Handler<Object> next) {
request.response().putHeader("Cache-Control", "no-store, no-cache");
next.handle(null);
}
}
代码示例来源:origin: pmlopes/yoke
EventSourceListener(int maxBytesStreaming, YokeRequest rc, SockJSSession session) {
super(rc, session);
this.maxBytesStreaming = maxBytesStreaming;
addCloseHandler(rc.response(), session);
}
代码示例来源:origin: pmlopes/yoke
HtmlFileListener(int maxBytesStreaming, YokeRequest rc, String callback, SockJSSession session) {
super(rc, session);
this.maxBytesStreaming = maxBytesStreaming;
this.callback = callback;
addCloseHandler(rc.response(), session);
}
代码示例来源:origin: pmlopes/yoke
@Override
public void handle(@NotNull YokeRequest request, @NotNull Handler<Object> next) {
request.response().putHeader("X-Download-Options", "noopen");
next.handle(null);
}
}
代码示例来源:origin: pmlopes/yoke
@Override
public void handle(@NotNull YokeRequest request, @NotNull Handler<Object> next) {
if ("/crossdomain.xml".equals(request.path())) {
request.response().putHeader("Content-Type", "text/x-cross-domain-policy");
request.response().end(DATA);
} else {
next.handle(null);
}
}
}
代码示例来源:origin: pmlopes/yoke
@Override
public void handle(@NotNull final YokeRequest request, @NotNull final Handler<Object> next) {
if ("/favicon.ico".equals(request.normalizedPath())) {
request.response().headers().setAll(icon.headers);
request.response().end(icon.body);
} else {
next.handle(null);
}
}
}
代码示例来源:origin: pmlopes/yoke
public void close() {
if (!closed) {
try {
session.resetListener();
rc.response().end();
rc.response().close();
closed = true;
} catch (IllegalStateException e) {
// Underlying connection might already be closed - that's fine
}
}
}
}
代码示例来源:origin: pmlopes/yoke
public void close() {
if (!closed) {
try {
session.resetListener();
rc.response().end();
rc.response().close();
} catch (IllegalStateException e) {
// Underlying connection might already be closed - that's fine
}
closed = true;
}
}
代码示例来源:origin: pmlopes/yoke
@Override
public void handle(@NotNull YokeRequest request, @NotNull Handler<Object> next) {
boolean isSecure = (request.isSSL())
|| ("on".equals(request.getHeader("front-end-https")))
|| ("https".equals(request.getHeader("x-forwarded-proto")));
if (isSecure) {
request.response().putHeader("Strict-Transport-Security", header);
}
next.handle(null);
}
}
代码示例来源:origin: pmlopes/yoke
@Override
public void handle(@NotNull YokeRequest request, @NotNull Handler<Object> next) {
if (dt - 500 * 1000000 > highWaterMark) {
final YokeResponse response = request.response();
response.setStatusCode(503);
response.setStatusMessage(message);
response.end();
} else {
next.handle(null);
}
}
}
代码示例来源:origin: pmlopes/yoke
/**
* Handle all forbidden errors, in this case we need to add a special header to the response
*
* @param request yoke request
* @param next middleware to be called next
*/
private void handle401(final YokeRequest request, final Handler<Object> next) {
YokeResponse response = request.response();
response.putHeader("WWW-Authenticate", "Basic realm=\"" + getRealm(request) + "\"");
response.setStatusCode(401);
next.handle("No authorization token");
}
代码示例来源:origin: pmlopes/yoke
@Override
public void handle(@NotNull final YokeRequest request, @NotNull final Handler<Object> next) {
JsonObject session = request.get("session");
if (session != null) {
if (session.getString("id") != null) {
next.handle(null);
return;
}
}
String redirect = request.getParam("redirect_url", Utils.encodeURIComponent(request.uri()));
request.response().redirect(loginURI + "?redirect_url=" + Utils.decodeURIComponent(redirect));
}
};
代码示例来源:origin: pmlopes/yoke
public static void setCORS(@NotNull YokeRequest request) {
String origin = request.headers().get("origin");
if (origin == null || "null".equals(origin)) {
origin = "*";
}
request.response().headers().set("Access-Control-Allow-Origin", origin);
request.response().headers().set("Access-Control-Allow-Credentials", "true");
String hdr = request.headers().get("Access-Control-Request-Headers");
if (hdr != null) {
request.response().headers().set("Access-Control-Allow-Headers", hdr);
}
}
代码示例来源:origin: pmlopes/yoke
public void sendFrame(String body) {
super.sendFrame(body);
rc.response().write(body + "\n");
close();
}
代码示例来源:origin: pmlopes/yoke
public void sendFrame(String body) {
if (log.isTraceEnabled()) log.trace("XHR sending frame");
if (!headersWritten) {
rc.response().putHeader("Content-Type", "application/javascript; charset=UTF-8");
setJSESSIONID(options, rc);
setCORS(rc);
rc.response().setChunked(true);
headersWritten = true;
}
}
代码示例来源:origin: pmlopes/yoke
private void handlePreflightRequest(final YokeRequest request)
{
if (isValidOrigin(request.getHeader(ORIGIN)))
{
addCorsResponseHeaders(request.getHeader(ORIGIN),
request.response().setStatusCode(204).setStatusMessage("No Content")).end();
}
else
{
request.response().setStatusCode(403).setStatusMessage("CORS Rejected").end();
}
}
本文整理了Java中com.jetdrone.vertx.yoke.middleware.YokeRequest.formAttributes()方法的一些代码示例,展示了YokeRequest.fo
本文整理了Java中com.jetdrone.vertx.yoke.middleware.YokeRequest.method()方法的一些代码示例,展示了YokeRequest.method()的具
本文整理了Java中com.jetdrone.vertx.yoke.middleware.YokeRequest.getHeader()方法的一些代码示例,展示了YokeRequest.getHead
本文整理了Java中com.jetdrone.vertx.yoke.middleware.YokeRequest.accepts()方法的一些代码示例,展示了YokeRequest.accepts()
本文整理了Java中com.jetdrone.vertx.yoke.middleware.YokeRequest.path()方法的一些代码示例,展示了YokeRequest.path()的具体用法。
本文整理了Java中com.jetdrone.vertx.yoke.middleware.YokeRequest.body()方法的一些代码示例,展示了YokeRequest.body()的具体用法。
本文整理了Java中com.jetdrone.vertx.yoke.middleware.YokeRequest.headers()方法的一些代码示例,展示了YokeRequest.headers()
本文整理了Java中com.jetdrone.vertx.yoke.middleware.YokeRequest.isSSL()方法的一些代码示例,展示了YokeRequest.isSSL()的具体用
本文整理了Java中com.jetdrone.vertx.yoke.middleware.YokeRequest.createSession()方法的一些代码示例,展示了YokeRequest.cre
本文整理了Java中com.jetdrone.vertx.yoke.middleware.YokeRequest.uri()方法的一些代码示例,展示了YokeRequest.uri()的具体用法。这些
本文整理了Java中com.jetdrone.vertx.yoke.middleware.YokeRequest.params()方法的一些代码示例,展示了YokeRequest.params()的具
本文整理了Java中com.jetdrone.vertx.yoke.middleware.YokeRequest.response()方法的一些代码示例,展示了YokeRequest.response
本文整理了Java中com.jetdrone.vertx.yoke.middleware.YokeRequest.get()方法的一些代码示例,展示了YokeRequest.get()的具体用法。这些
我是一名优秀的程序员,十分优秀!