本部分提供了概述,关于RESTful服务在GeoServer中是如何工作的。
https://docs.geoserver.org/stable/en/developer/programming-guide/rest-services/index.html
第一章:Overview概述
GeoServer uses a library known as Restlet for all REST related functionality. Restlet is a lightweight rest framework written in Java that integrates nicely with existing servlet based applications.
GeoServer使用一个类库叫做Restlet来处理所有的REST相关的功能。Restlet是一个轻量级的REST框架,以Java语言写的,与现有的Servlet程序能够完美的融合。
REST dispatching
In GeoServer, all requests under the path /rest
are considered a call to a restful service. Every call of this nature is handled by a rest dispatcher. The job of the dispatcher is to route the request to the appropriate end point. This end point is known as a restlet.

Restlets are loaded from the spring context, and therefore are pluggable.
Restlets
A restlet is the generic entity which handles calls routed by the dispatcher, and corresponds to the class org.restlet.Restlet
. One can extend this class directly to implement a service endpoint. Alternatively one can extend a subclass for a specialized purpose. Namely a finder, which is described in the next section.
Finders and resources¶
Restful services are often implemented around the concept of resources. A finder is a special kind of restlet whose job is to find the correct resource for a particular request. The resource then serves as the final end point and handles the request. The appropriate classes from the restlet library are org.restlet.Finder
and org.restlet.resource.Resource
.
Representations
A representation, commonly referred to as a format, is the state of a particular state or encoding of a resource. For instance, when a request for a particular resource comes in, a representation of that resource is returned to the client.
最新的GeoServer是使用SpringMVC来实现的REST服务,抛弃了Restlet。。:https://blog.csdn.net/nmj2008/article/details/116997868 从GeoServer2.12版(2017)开始采用的SpringMVC,但是开发文档没有更新
新旧REST对比:
左边为原来实现REST的方式,很简单就实现了一个REST服务。但是,新的例子不能用
应该换成哪些类呢?
调试:发现从DispatcherServlet->RestInterceptor->RequestInfo
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
· 没有源码,如何修改代码逻辑?
· 分享4款.NET开源、免费、实用的商城系统
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
· 上周热点回顾(2.24-3.2)
2018-05-18 PyTorch入门教程