I am a newbie to geoserver and openlayers. Recently, I am stuck in saving changes(drawing polygons and points) of the feature vectors to a local(geoserver/www/...) .json file.

The tutorial I followed is here. But it said:

"Of course you also need a program on your server that knows what to do with the transactions sent by the protocol/strategy. The server side has nothing to do with OL, but you can't demonstrate functionality without it, so I'll use a workspace I play around with (which uses FeatureServer, which sadly has not been much supported in recent years). This is only for small-scale test purposes, and any features entered in it may disappear at any time."

Besides, http://featureserver.org/ cannot be visited. So I wonder if it is possible to write a server program myself and replace the url with "http://localhost:XXXX/MyWebServer/index.jsp" under the OpenLayers.Protocol.HTTP. Then the index.jsp file will handle the GET/PUT request and response to send or save the json file.

Since I am a beginner, correct me if anything I mentioned is wrong. That would be appreciated.

1 Answer 1


To save features edited with OpenLayers you need a server side component that speaks WFS-T like TinyOWS. You could of course write one yourself, but I guess that will take longer.

TinyOWS is actively maintained and one of the examples shows how to integrate it with OpenLayers.

  • Thx for so fast reply.I will try it.Besides, I have written a java serverlet to handle the GET request from the OpenLayers.Protocol.HTTP. The JSON feature can be displayed well. But when I save features like moving points. My firefox gives me "PUT null || 403 Forbidden...". But I put the openlayers.html file(show the map and features), the java servlet file(handle GET and PUT request) under the same directory, like "...\workspace\SimpleServletProject\". The openlayers.html is under "WebContent" directory and the servlet.java under "src" directory. Do you have any ideas about it? Thanks again!
    – wagyaoo
    Jun 30, 2012 at 10:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.