No title delete lock Revision 623763306433 (Mon Dec 06 2010 at 10:18) - Diff Link to this snippet: https://friendpaste.com/2TWnYXrIvZ9OTX46WtWCUJ Embed: manni perldoc borland colorful default murphy trac fruity autumn bw emacs pastie friendly Show line numbers Wrap lines 123456789101112131415161718192021222324252627282930313233Index: RestViewJsonService.java===================================================================--- RestViewJsonService.java (revision 334)+++ RestViewJsonService.java (working copy)@@ -55,18 +55,22 @@ @Override public void renderService() throws ServiceException {- if ("GET".equalsIgnoreCase(getHttpRequest().getMethod())) {+ String method = getHttpRequest().getMethod();+ if ("GET".equalsIgnoreCase(method)) { renderServiceJSONGet();- } else if ("POST".equalsIgnoreCase(getHttpRequest().getMethod())) {- renderServiceJSONUpdate(0);- } else if ("PUT".equalsIgnoreCase(getHttpRequest().getMethod())) {+ } else if ("POST".equalsIgnoreCase(method)) {+ String override = getHttpRequest().getHeader("X-HTTP-Method-Override");+ if ("PUT".equalsIgnoreCase(override)) renderServiceJSONUpdate(1);+ else if ("DELETE".equalsIgnoreCase(override)) renderServiceJSONUpdate(2);+ else renderServiceJSONUpdate(0);+ } else if ("PUT".equalsIgnoreCase(method)) { renderServiceJSONUpdate(1);- } else if ("DELETE".equalsIgnoreCase(getHttpRequest().getMethod())) {+ } else if ("DELETE".equalsIgnoreCase(method)) { renderServiceJSONUpdate(2); } else { // Use a different status for an error? //HttpServletResponse.SC_METHOD_NOT_ALLOWED;- throw new ServiceException(null,"Method {0} is not allowed with JSON Rest Service",getHttpRequest().getMethod());+ throw new ServiceException(null,"Method {0} is not allowed with JSON Rest Service",method); } }