gpt4 book ai didi

com.jetdrone.vertx.yoke.middleware.YokeResponse.redirect()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-15 08:58:49 25 4
gpt4 key购买 nike

本文整理了Java中com.jetdrone.vertx.yoke.middleware.YokeResponse.redirect()方法的一些代码示例,展示了YokeResponse.redirect()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YokeResponse.redirect()方法的具体详情如下:
包路径:com.jetdrone.vertx.yoke.middleware.YokeResponse
类名称:YokeResponse
方法名:redirect

YokeResponse.redirect介绍

暂无

代码示例

代码示例来源:origin: pmlopes/yoke

public void redirect(String url) {
  redirect(302, url);
}

代码示例来源:origin: pmlopes/yoke

@Override
 public void handle(YokeRequest request) {
  request.response().redirect("/index.html");
 }
});

代码示例来源: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

@Override
  public void handle(JsonObject user) {
    if (user != null) {
      JsonObject session = request.createSession();
      session.put("user", request.getFormAttribute("username"));
      // get the redirect_url parameter
      String redirect = request.getParam("redirect_url", "/");
      request.response().redirect(Utils.decodeURIComponent(redirect));
    } else {
      if (loginTemplate != null) {
        // render internal login
        request.response().setContentType("text/html");
        request.response().setStatusCode(401);
        request.response().end(
            loginTemplate.replace("{title}", (String) request.get("title"))
                .replace("{action}", loginURI + "?redirect_url=" + Utils.encodeURIComponent(request.getParam("redirect_url", "/")))
                .replace("{message}", "Invalid username and/or password, please try again."));
      } else {
        next.handle(401);
      }
    }
  }
});

代码示例来源:origin: pmlopes/yoke

switch (action.getType()) {
  case REDIRECT:
    request.response().redirect(HttpConstants.TEMP_REDIRECT, action.getLocation());
    break;
  case SUCCESS:

代码示例来源:origin: pmlopes/yoke

request.response().redirect(Utils.decodeURIComponent(redirect));
return;

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com