我已遵循this example来使用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中获取整个stacktrace,并确保触发了什么约束,是否可以通过openlayers获得更多详细信息?
在global settings page中,您可以选中显示include stack trace in service exception
的框,以在返回OpenLayers的XML中提供堆栈跟踪。