javascript - Geoserver 和 Openlayers - 在 WFS-T 中显示详细的消息错误
问题描述
我已按照此示例使用 geoserver 在 openlayers 地图中保存/编辑元素
地理服务器层通过 postgis 连接到 postgres 数据库;在 postgis 中,我添加了有关插入新记录的某些约束,即两个多边形不能相互接触/不能包含另一个多边形
如何使用 openlayers 显示这些约束错误?使用 WFS-T 插入请求,我只收到以下消息:
<ows:ExceptionReport xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:ows="http://www.opengis.net/ows" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.0.0" xsi:schemaLocation="http://www.opengis.net/ows http://myserver:8080/geoserver/schemas/ows/1.0.0/owsExceptionReport.xsd">
<ows:Exception exceptionCode="InvalidParameterValue">
<ows:ExceptionText>Update error: Error occured updating features</ows:ExceptionText>
</ows:Exception>
</ows:ExceptionReport>
我可以在 geoserver 中获取整个堆栈跟踪并确保触发了什么约束,有没有办法通过 openlayers 获得更多细节?
解决方案
在全局设置页面中,您可以选中表示include stack trace in service exception
在返回给 OpenLayers 的 XML 中提供堆栈跟踪的框。
推荐阅读
- ios - 横向隐藏所有 iPhone 类型的 iOS 13 状态栏
- html - 如何使用 gtag 获取元素?
- javascript - 拒绝从“url”执行脚本,因为它的 MIME 类型(“image/jpeg”)不可执行
- amazon-ses - 通过 Amazon SES 发送的电子邮件在@icloud.com 邮箱中被多次接收
- java - Selenium 悬停功能在第二次调用时不起作用
- python - 捕获 RTP 时间戳
- javascript - Angular8 拖拽问题与拖拽有多种情况
- elasticsearch - Elastic Search 多词同义词无法按预期工作
- javascript - 从 URL 中获取 Query 参数到 Component
- git - Git:检查文件是否是某个提交的一部分