本文整理了Java中io.vertx.ext.web.RoutingContext.data
方法的一些代码示例,展示了RoutingContext.data
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。RoutingContext.data
方法的具体详情如下:
包路径:io.vertx.ext.web.RoutingContext
类名称:RoutingContext
方法名:data
RoutingContext.data介绍
暂无
代码示例
代码示例来源:origin: vert-x3/vertx-web
@Override
public Map data() {
return decoratedContext.data();
}
代码示例来源:origin: vert-x3/vertx-web
@Override
public Map data() {
return inner.data();
}
代码示例来源:origin: vert-x3/vertx-web
/**
* Render the template
*
* @param context the routing context
* @param templateFileName the template file name to use
* @param handler the handler that will be called with a result containing the buffer or a failure.
*
* @deprecated use {@link #render(RoutingContext, String, String, Handler)}
*/
@Deprecated
default void render(RoutingContext context, String templateFileName, Handler> handler) {
render(new JsonObject(context.data()), templateFileName, handler);
}
代码示例来源:origin: vert-x3/vertx-web
/**
* Render the template
*
* NOTE if you call method directly (i.e. not using {@link io.vertx.ext.web.handler.TemplateHandler}) make sure
* that templateFileName is sanitized via {@link io.vertx.ext.web.impl.Utils#normalizePath(String)}
*
* @param context the routing context
* @param templateDirectory the template directory to use
* @param templateFileName the relative template file name to use
* @param handler the handler that will be called with a result containing the buffer or a failure.
*/
@Deprecated
default void render(RoutingContext context, String templateDirectory, String templateFileName, Handler> handler) {
render(new JsonObject(context.data()), templateDirectory + templateFileName, handler);
}
代码示例来源:origin: apache/servicecomb-java-chassis
protected String getValueFromInvocationContext(AccessLogParam accessLogParam) {
Map data = accessLogParam.getContextData().data();
if (null == data) {
return null;
}
Invocation invocation = (Invocation) data.get(RestConst.REST_INVOCATION_CONTEXT);
if (null == invocation) {
return null;
}
return invocation.getContext(varName);
}
代码示例来源:origin: vert-x3/vertx-web
if (!context.data().containsKey("lang")) {
for (LanguageHeader acceptableLocale : context.acceptableLanguages()) {
try {
context.data().put("lang", acceptableLocale.value());
break;
engine.render(new JsonObject(context.data()), templateDirectory + file, res -> {
if (res.succeeded()) {
context.response().putHeader(HttpHeaders.CONTENT_TYPE, contentType).end(res.result());
代码示例来源:origin: io.vertx/vertx-rx-java
/**
* @return all the context data as a map
*/
public Map data() {
Map ret = delegate.data();
return ret;
}
代码示例来源:origin: io.vertx/vertx-web
@Override
public Map data() {
return inner.data();
}
代码示例来源:origin: vert-x3/vertx-rx
/**
* @return all the context data as a map
*/
public Map data() {
Map ret = delegate.data();
return ret;
}
代码示例来源:origin: io.vertx/vertx-web
@Override
public Map data() {
return decoratedContext.data();
}
代码示例来源:origin: gentics/mesh
@Override
public Map data() {
return rc.data();
}
代码示例来源:origin: FroMage/redpipe
@Override
public Map data() {
return delegate.data();
}
代码示例来源:origin: gentics/mesh
/**
* Return the current project info.
*
* @return Project info
*/
public JsonObject project() {
return (JsonObject) rc.data().get("mesh.project");
}
代码示例来源:origin: gentics/mesh
/**
* Create a new routing context based vertx action context.
*
* @param rc
*/
public InternalRoutingActionContextImpl(RoutingContext rc) {
this.rc = rc;
if (rc.data() != null) {
this.data = Collections.synchronizedMap(rc.data());
} else {
this.data = new ConcurrentHashMap<>();
}
}
代码示例来源:origin: io.helixservice/helix-rest
private void insertIntoFilterChain(RoutingContext routingContext) {
@SuppressWarnings("unchecked")
List handleAfterChain = (List) routingContext.data().get(FILTER_CHAIN);
if (handleAfterChain == null) {
handleAfterChain = new ArrayList<>();
routingContext.data().put(FILTER_CHAIN, handleAfterChain);
}
handleAfterChain.add(0, this);
}
代码示例来源:origin: io.vertx/vertx-web
/**
* Render the template
*
* @param context the routing context
* @param templateFileName the template file name to use
* @param handler the handler that will be called with a result containing the buffer or a failure.
*
* @deprecated use {@link #render(RoutingContext, String, String, Handler)}
*/
@Deprecated
default void render(RoutingContext context, String templateFileName, Handler> handler) {
render(new JsonObject(context.data()), templateFileName, handler);
}
代码示例来源:origin: org.apache.servicecomb/transport-rest-vertx
protected String getValueFromInvocationContext(AccessLogParam accessLogParam) {
Map data = accessLogParam.getContextData().data();
if (null == data) {
return null;
}
Invocation invocation = (Invocation) data.get(RestConst.REST_INVOCATION_CONTEXT);
if (null == invocation) {
return null;
}
return invocation.getContext(varName);
}
代码示例来源:origin: io.helixservice/helix-rest
private FilterContext buildFilterContext(RoutingContext routingContext) {
return new FilterContext(buildRequest(routingContext),
buildResponse(routingContext), routingContext.data());
}
代码示例来源:origin: cn.vertxup/vertx-up
static Envelop continuous(final RoutingContext context,
final T entity) {
final Envelop envelop = Envelop.success(entity);
envelop.setHeaders(context.request().headers());
envelop.setUser(context.user());
envelop.setSession(context.session());
envelop.setContext(context.data());
return envelop;
}
代码示例来源:origin: silentbalanceyh/vertx-zero
static Envelop continuous(final RoutingContext context,
final T entity) {
final Envelop envelop = Envelop.success(entity);
envelop.setHeaders(context.request().headers());
envelop.setUser(context.user());
envelop.setSession(context.session());
envelop.setContext(context.data());
return envelop;
}