To teach myself Restlet, I am trying to port the example bookmarking 
application from chapter 7 of Richardson and Ruby's "RESTful Web Services". 

In their example, they put "before" filters on their objects to check if the 
user whose information is being requested matches the user whose credentials 
were used to authenticate. 

It does this by looking at the user name in the entity. I tried to recreate 
this functionality in Restlet by creating a subclass of Filter called 
MustSpecifyUserFilter and reading the
entity by calling getEntityAsForm inside the filter's beforeHandle method, but 
this causes the entity to be marked as unavailable and a 400 to be returned 
before my Resource code can process it (In my Resource subclass, I am only 
overriding storeRepresentation rather than handlePut).

Should I give up trying to use Filters to recreate this functionality or is 
there another way such as overriding handlePut to ignore the "available" 
attribute on the entity?

I am using Restlet 1.1.4.

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

Reply via email to