本文整理了Java中io.vertx.ext.web.Route.useNormalisedPath
方法的一些代码示例,展示了Route.useNormalisedPath
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Route.useNormalisedPath
方法的具体详情如下:
包路径:io.vertx.ext.web.Route
类名称:Route
方法名:useNormalisedPath
[英]If true then the normalised request path will be used when routing (e.g. removing duplicate /) Default is true
[中]如果为true,则当路由(例如删除重复/)默认值为true时,将使用标准化的请求路径
代码示例来源:origin: vert-x3/vertx-rx
/**
* If true then the normalised request path will be used when routing (e.g. removing duplicate /)
* Default is true
* @param useNormalisedPath use normalised path for routing?
* @return a reference to this, so the API can be used fluently
*/
public io.vertx.rxjava.ext.web.Route useNormalisedPath(boolean useNormalisedPath) {
delegate.useNormalisedPath(useNormalisedPath);
return this;
}
代码示例来源:origin: io.vertx/vertx-rx-java
/**
* If true then the normalised request path will be used when routing (e.g. removing duplicate /)
* Default is true
* @param useNormalisedPath use normalised path for routing?
* @return a reference to this, so the API can be used fluently
*/
public io.vertx.rxjava.ext.web.Route useNormalisedPath(boolean useNormalisedPath) {
delegate.useNormalisedPath(useNormalisedPath);
return this;
}
代码示例来源:origin: gentics/mesh
@Override
public InternalEndpointRoute useNormalisedPath(boolean useNormalisedPath) {
route.useNormalisedPath(useNormalisedPath);
return this;
}
代码示例来源:origin: vert-x3/vertx-web
@Override
public SockJSHandler socketHandler(Handler<SockJSSocket> sockHandler) {
router.route("/").useNormalisedPath(false).handler(rc -> {
if (log.isTraceEnabled()) log.trace("Returning welcome response");
rc.response().putHeader("Content-Type", "text/plain; charset=UTF-8").end("Welcome to SockJS!\n");
代码示例来源:origin: wang007/vertx-start
@Override
public Route useNormalisedPath(boolean useNormalisedPath) {
return delegate.useNormalisedPath(useNormalisedPath);
}
代码示例来源:origin: vert-x3/vertx-web
@Test
public void testGetWithPlusPath2() throws Exception {
router.get("/:param1").useNormalisedPath(false).handler(rc -> {
assertEquals("/some+path", rc.normalisedPath());
assertEquals("some+path", rc.pathParam("param1"));
assertEquals("some query", rc.request().getParam("q1"));
rc.response().setStatusMessage("foo").end();
});
testRequest(HttpMethod.GET, "/some+path?q1=some+query", 200, "foo");
}
代码示例来源:origin: io.vertx/vertx-web
@Override
public SockJSHandler socketHandler(Handler<SockJSSocket> sockHandler) {
router.route("/").useNormalisedPath(false).handler(rc -> {
if (log.isTraceEnabled()) log.trace("Returning welcome response");
rc.response().putHeader("Content-Type", "text/plain; charset=UTF-8").end("Welcome to SockJS!\n");
代码示例来源:origin: io.vertx/vertx-web
@Test
public void testGetWithPlusPath2() throws Exception {
router.get("/:param1").useNormalisedPath(false).handler(rc -> {
assertEquals("/some+path", rc.normalisedPath());
assertEquals("some+path", rc.pathParam("param1"));
assertEquals("some query", rc.request().getParam("q1"));
rc.response().setStatusMessage("foo").end();
});
testRequest(HttpMethod.GET, "/some+path?q1=some+query", 200, "foo");
}
内容来源于网络,如有侵权,请联系作者删除!