Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

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.

Thanks in advance.

share|improve this question
add comment

1 Answer

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

Your Answer

 
discard

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.