@@ -0,0 +1,1168 @@
+/**%0A * Copyright (C) 2009 - 2010 by OpenGamma Inc.%0A *%0A * Please see distribution for license.%0A */%0Apackage com.opengamma.transport.jaxrs;%0A%0Aimport javax.ws.rs.core.MediaType;%0A%0Aimport com.sun.jersey.spi.container.ContainerRequest;%0Aimport com.sun.jersey.spi.container.ContainerRequestFilter;%0A%0A/**%0A * Servlet filter to handle incoming HTML forms.%0A * %3Cp%3E%0A * HTML only supports GET and POST, so PUT and DELETE must be tunneled.%0A * This class examines the %7B@code method%7D form parameter and uses that if it matches%0A * %7B@code PUT%7D or %7B@code DELETE%7D.%0A */%0Apublic class HttpMethodFilter implements ContainerRequestFilter %7B%0A%0A  @Override%0A  public ContainerRequest filter(ContainerRequest request) %7B%0A    if (request.getMethod().equalsIgnoreCase(%22POST%22) == false) %7B%0A      return request;%0A    %7D%0A    if (request.getMediaType().equals(MediaType.APPLICATION_FORM_URLENCODED_TYPE) == false) %7B%0A      return request;%0A    %7D%0A    String methodFormParam = request.getFormParameters().getFirst(%22method%22);%0A    if (%22PUT%22.equals(methodFormParam)) %7B%0A      request.setMethod(%22PUT%22);%0A    %7D else if (%22DELETE%22.equals(methodFormParam)) %7B%0A      request.setMethod(%22DELETE%22);%0A    %7D%0A    return request;%0A  %7D%0A%0A%7D%0A

Add filter to tunnel PUT/DELETE