Every time you make a HTTP call, Restlet will create a new instance of your 
ServerResource.  ServerResources must therefore not be stateful.  Does this 
explain the problem you are seeing?


On Feb 18, 2011, at 8:20 AM, Jason Richards wrote:

> Is there an example on how to route to a ServerResource or Restlet(), pass 
> off a variable passed in to server side code, have it do something complex 
> with the data and pass back data through a @Get to the client? I have been 
> able to do this but it only works for one call of it. After that the 
> ServerResource seems to be stale if that makes sense. It only returns nulls 
> after the first call. For example, if I passed in the name "Jason" then I 
> called a server side method that took the variable "Jason" and queried a DB 
> for all records on "Jason" then returned them I would get several items of 
> information. If I immediately tried to do another Get from the ServerResource 
> with the name "George" I would only get null responses. I am not sure how to 
> reset the ServerResource to be available to another call right after. 
> 
> I hope that makes sense.
> 
> ------------------------------------------------------
> http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2705352

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

Reply via email to