Hi everyone,

I have writed a simple resource that extend "ServerResource" and override 
"delete(Variant v)". When I do a DELETE request on this resource nothing 
happened. So I have overrided "get(Variant v)" and now when I do a DELETE 
request, the "get" method is called.
I have added many breakpoints and I can see that the get method is called from 
the getInfo method..

But I don't want that, I want to delete a resource not to retrieve it and I 
don't really understand why the default "getInfo(Variant v)" method call the 
"get(Variant v)" method.

Can you help me ?

Thanks.


Here is my resource : 
public class TemplateResource extends ServerResource {
  @Override
  protected void init() {                 
    getVariants().put(Method.DELETE,  
        Arrays.asList(new Variant[]{
            new Variant(MediaType.TEXT_XML),
            new Variant(MediaType.APPLICATION_XML)
        }));
  }
  @Override
  protected Representation get(Variant variant) throws ResourceException {
    System.out.println("GET "+getRequestAttributes().get("identifier"));
    return super.get(variant);
  }
  @Override
  protected Representation delete(Variant variant) throws ResourceException {
    System.out.println("DELETE "+getRequestAttributes().get("identifier"));
    return Representation.createEmpty();
  }

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2416250

Reply via email to