# HG changeset patch # User casties # Date 1332509235 -3600 # Node ID a681113fd0eb923cbb1cbed1482cdb8274532084 # Parent 383c0fee2d37868d1067be75b14019811f80c0ac PUT returns 303 according to spec now. seems not to work with the client :-( diff -r 383c0fee2d37 -r a681113fd0eb src/de/mpiwg/itgroup/annotationManager/restlet/AnnotatorAnnotations.java --- a/src/de/mpiwg/itgroup/annotationManager/restlet/AnnotatorAnnotations.java Fri Mar 23 12:13:48 2012 +0100 +++ b/src/de/mpiwg/itgroup/annotationManager/restlet/AnnotatorAnnotations.java Fri Mar 23 14:27:15 2012 +0100 @@ -14,6 +14,7 @@ import org.restlet.Context; import org.restlet.data.Form; import org.restlet.data.MediaType; +import org.restlet.data.Reference; import org.restlet.data.Status; import org.restlet.ext.json.JsonRepresentation; import org.restlet.representation.Representation; @@ -291,6 +292,7 @@ @Put("json") public Representation doPutJSON(Representation entity) { logger.debug("AnnotatorAnnotations doPutJSON!"); + Reference thisUrl = this.getReference(); setCorsHeaders(); // id from URI /annotations/{id} String jsonId = (String) getRequest().getAttributes().get("id"); @@ -328,12 +330,10 @@ // store Annotation storedAnnot = new Convert("file:///annotations").storeAnnotation(annot); /* according to https://github.com/okfn/annotator/wiki/Storage - * we should return 303: see other. - * For now we return the annotation. - */ - jo = createAnnotatorJson(storedAnnot); - JsonRepresentation retRep = new JsonRepresentation(jo); - return retRep; + * we should return 303: see other. */ + setStatus(Status.REDIRECTION_SEE_OTHER); + // go to same URL as this one + this.getResponse().setLocationRef(thisUrl); } catch (TripleStoreHandlerException e) { e.printStackTrace(); setStatus(Status.SERVER_ERROR_INTERNAL, "TripleStoreHandler Error");