Hi,

I am a new in using restlet framework. I followed this great tutorial to
make client(Android)-server(GAE) application (
http://wiki.restlet.org/docs_2.0/13-restlet/21-restlet/318-restlet/303-restlet.html
http://wiki.restlet.org/docs_2.0/13-restlet/21-restlet/318-restlet/303-restlet.html
). Everything is working fine. But i would like to add small enhancement in
my application. To have ability to send parameter in GET method. Please see
below a code that i have

public interface ContactResource {
    @Get
    public Contact retrieve(String contactID);
}

********************GAE***************************
public class ContactServerResource extends ServerResource implements
ContactResource {
    @Get
    public Contact retrieve(String contactID) {
        return (Contact)db.GqlQuery("SELECT * FROM MyModel WHERE CONTACTID
== " + contactID)
    }
}


    public Restlet createInboundRoot() { 
        Router router = new Router(getContext()); 
        getConnectorService().getClientProtocols().add(Protocol.FILE); 
  
        // Serve the files generated by the GWT compilation step. 
        Directory dir = new Directory(getContext(),
LocalReference.createFileReference(new File("war/"))); 
        router.attachDefault(dir); 
        router.attach("/contacts", ContactServerResource.class); 
  
        return router; 

********************Android***************************
ClientResource cr = new
ClientResource("http://myserver.appspot.com/contacts";); 
ContactResource resource = cr.wrap(ContactResource.class);   
Contact contact = resource.retrieve("1234567"); 

Everything is running without errors, the problem is that contactID has been
receiving null(empty) in GAE. I didn’t find any suitable examples for @Get
method which retrieve parameters.
Is there anyway to send contactID?
Thanks
-- 
View this message in context: 
http://restlet-discuss.1400322.n2.nabble.com/Send-parameter-in-Get-method-from-Android-to-GAE-tp5392693p5392693.html
Sent from the Restlet Discuss mailing list archive at Nabble.com.

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

Reply via email to