RE: Re: PUT requests return 405 code with @Put annotated method using 2.0.1 release

2010-12-08 Thread markcallen
Check your import statements in the ServerResource.  They should be like:

import org.restlet.resource.Put;

I spent some time chasing this one around for a while.

Mark.
-- 
View this message in context: 
http://restlet-discuss.1400322.n2.nabble.com/PUT-requests-return-405-code-with-Put-annotated-method-using-2-0-1-release-tp5603984p5814511.html
Sent from the Restlet Discuss mailing list archive at Nabble.com.

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


RE: Re: PUT requests return 405 code with @Put annotated method using 2.0.1 release

2010-10-08 Thread webpost
Hi Dustin,

I've reproduced the error with a minimal test:


public class ApiApplication extends Application{

public static final String TEST_URL = "test";

public ApiApplication(Context context){
super(context);
}

@Override
public Restlet createInboundRoot(){

Router router = new Router(this.getContext());
router.attach("/" + TEST_URL, TestResource.class);

return router;
}
}



public class TestResource extends ServerResource {

@Get
public String doGet() {
return "hello, world";
}

@Put
public void store(Representation representation) {
System.out.println("PUT");
}


The GET method works properly, but the PUT method does not.

I don't know if it is important but I've just tested with development server.

Best regards,

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