Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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, 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.

Thanks in advance.

share|improve this question

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.

share|improve this answer
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 under "src" directory. Do you have any ideas about it? Thanks again! – wagyaoo Jun 30 '12 at 10:38

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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