ro.pippo.core.Response.notFound()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(2.4k)|赞(0)|评价(0)|浏览(197)

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

Response.notFound介绍

[英]Set the response status to NOT FOUND (404).

The requested resource could not be found but may be available again in the future. Subsequent requests by the client are permissible.
[中]将响应状态设置为未找到(404)。
无法找到请求的资源,但将来可能会再次可用。客户的后续请求是允许的。

代码示例

代码示例来源:origin: pippo-java/pippo

if (response.getStatus() == 0) {
  log.debug("Status code not set for {} '{}'", requestMethod, requestPath);
  response.notFound();

代码示例来源:origin: pippo-java/pippo

routeContext.getResponse().notFound();
} else {

代码示例来源:origin: gitblit/fathom

protected void serveSpecification(RouteContext ctx, String specificationName) {
  String extension = Files.getFileExtension(specificationName);
  if (extension.isEmpty()) {
    // default to json
    specificationName += ".json";
  }
  final String finalDocumentName = specificationName;
  final String finalExtension = Files.getFileExtension(finalDocumentName);
  String document = specifications.get(finalDocumentName.toLowerCase());
  if (document == null) {
    ctx.getResponse().notFound();
  } else {
    ctx.getResponse().ok();
    httpCacheToolkit.addEtag(ctx, startTime);
    if ("json".equals(finalExtension)) {
      ctx.json();
    } else if ("yaml".equals(finalExtension)) {
      ctx.yaml();
    } else {
      ctx.text();
    }
    if (HttpMethod.GET.equals(ctx.getRequestMethod())) {
      ctx.getResponse().send(document);
    }
  }
}

代码示例来源:origin: com.gitblit.fathom/fathom-rest-swagger

protected void serveSpecification(RouteContext ctx, String specificationName) {
  String extension = Files.getFileExtension(specificationName);
  if (extension.isEmpty()) {
    // default to json
    specificationName += ".json";
  }
  final String finalDocumentName = specificationName;
  final String finalExtension = Files.getFileExtension(finalDocumentName);
  String document = specifications.get(finalDocumentName.toLowerCase());
  if (document == null) {
    ctx.getResponse().notFound();
  } else {
    ctx.getResponse().ok();
    httpCacheToolkit.addEtag(ctx, startTime);
    if ("json".equals(finalExtension)) {
      ctx.json();
    } else if ("yaml".equals(finalExtension)) {
      ctx.yaml();
    } else {
      ctx.text();
    }
    if (HttpMethod.GET.equals(ctx.getRequestMethod())) {
      ctx.getResponse().send(document);
    }
  }
}

代码示例来源:origin: ro.pippo/pippo-controller

routeContext.getResponse().notFound();
} else {

代码示例来源:origin: com.gitblit.fathom/fathom-rest

context.getResponse().notFound();

代码示例来源:origin: gitblit/fathom

context.getResponse().notFound();

相关文章