org.geoserver.ows.Request.getContext()方法的使用及代码示例

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

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

Request.getContext介绍

[英]The context of the url path of the request.

The context is anything before the part that matches an ows service. For instance in:

  1. /foo/bar/wfs?...

The context would be "/foo/bar".
[中]请求的url路径的上下文。
上下文是匹配ows服务的部分之前的任何内容。例如:

  1. /foo/bar/wfs?...

上下文应该是“/foo/bar”。

代码示例

代码示例来源:origin: geoserver/geoserver

  1. /**
  2. * Returns true if the layer should be hidden, false otherwise
  3. *
  4. * <ol>
  5. * <li>has a request
  6. * <li>is a GetCapabilities request
  7. * <li>is not for a layer-specific virtual service
  8. * </ol>
  9. */
  10. boolean checkCapabilitiesRequest(ResourceInfo resource) {
  11. Request request = Dispatcher.REQUEST.get();
  12. if (request != null) {
  13. if ("GetCapabilities".equalsIgnoreCase(request.getRequest())) {
  14. String resourceContext =
  15. resource.getNamespace().getPrefix() + "/" + resource.getName();
  16. return !resourceContext.equalsIgnoreCase(request.getContext());
  17. }
  18. }
  19. return false;
  20. }

代码示例来源:origin: geoserver/geoserver

  1. if (req.getContext() != null) {
  2. serviceDescriptor =
  3. findService(req.getContext(), req.getVersion(), req.getNamespace());
  4. if (serviceDescriptor != null) {
  5. req.setRequest(req.getService());
  6. req.setService(req.getContext());
  7. req.setContext(null);

代码示例来源:origin: org.geoserver/gwc

  1. @Override
  2. public Request init(Request request) {
  3. String context = request.getContext();
  4. if (context == null || !context.startsWith("gwc/service")) {
  5. return null;
  6. }
  7. Map<String, String> kvp = new HashMap<String, String>();
  8. kvp.put("service", "gwc");
  9. kvp.put("version", "1.0.0");
  10. kvp.put("request", "dispatch");
  11. request.setKvp(kvp);
  12. request.setRawKvp(kvp);
  13. return request;
  14. }

代码示例来源:origin: org.geoserver/gs-wfs

  1. @Override
  2. protected void qualifyRequest(
  3. WorkspaceInfo workspace, PublishedInfo layer, Service service, Request request) {
  4. if (request.getContext() != null) {

代码示例来源:origin: org.geoserver/gs-gwc

  1. @Override
  2. public Request init(Request request) {
  3. String context = request.getContext();
  4. if (context == null || !isGwcServiceTargeted(context)) {
  5. return null;

相关文章