Re: removeRepresentations and setAvailable

2008-11-21 Thread Richard Hoberman
hod removeRepresentations still gets invoked, which means I have to >> explicitly handle the 404 response. >> >> Is this the correct behaviour? >> >> Regards >> >> Richard Hoberman

removeRepresentations and setAvailable

2008-11-19 Thread Richard Hoberman
handle the 404 response. Is this the correct behaviour? Regards Richard Hoberman

Re: [Tomcat] ETag dropped between Client and acceptRepresentation?

2008-11-18 Thread Richard Hoberman
ders (line 133, revision 2965) - >> modifies response >> HttpClientCall.copyResponseEntityHeaders (line 143, revision 3882) - not >> called but I'm guessing modifies response >> >> Is there something wrong with my understanding of ETags or how they are >> set/read in Restlet? Can anyone point me to the class that should be >> handling this? >> >> I've also tried setting a custom header on the request as a workaround: >> >> request.getAttributes().put("my-custom-tag", "tag value") >> >> This doesn't seem to propagate either. Either I need sleep or there is >> a general mechanism that is broken. >> >> Regards >> >> Richard Hoberman >> >>

Re: [Tomcat] ETag dropped between Client and acceptRepresentation?

2008-11-18 Thread Richard Hoberman
The penny has dropped. ETag is a *response*-header field. So I guess this behaviour is correct. Best regards Richard Hoberman

[Tomcat] ETag dropped between Client and acceptRepresentation?

2008-11-17 Thread Richard Hoberman
be handling this? I've also tried setting a custom header on the request as a workaround: request.getAttributes().put("my-custom-tag", "tag value") This doesn't seem to propagate either. Either I need sleep or there is a general mechanism that is broken. Regards Richard Hoberman

Re: (Bug?) entity for "" receives null mediaType when deployed on Tomcat

2008-11-17 Thread Richard Hoberman
Hi Rob I tested this against Tomcat-5.5.27. The problem is also affecting code running on 5.5.25. Cheers Richard Rob Heittman wrote: > Thanks, Richard! Can you share a Tomcat version number? This sounds > like the same issue we've been seeing in GWT hosted mode, and I've > been trying to fig

Restricting PUT to update only

2008-10-20 Thread Richard Hoberman
Hi How do I implement a resource so that it supports PUT for update but not creation? This particular resource should be created by POST and updated via PUT. Do I throw a ResourceException from storeRepresentation? Best regards Richard Hoberman

Best practices for read-only fields?

2008-10-17 Thread Richard Hoberman
or optimistic concurrency. There would be a trade-off of performance for ease of code creation and maintenance but I think that would be acceptable for the service I am working on. I'm now considering option 3. Anyone have a better way or useful advice? Best regards Richard Hoberman

Re: XmlRepresentation.internalEval

2008-10-15 Thread Richard Hoberman
Tim Peierls wrote: > It's not a huge deal, but superfluous final keywords are clutter that > distract from the places where final is being used meaningfully. I > think it's worth cleaning this up incrementally in Restlet. This would do it: perl -pie 's/final (?=[a-zA-Z]*Exception)//g' `find . -na

Re: POST/GET and URL confusion

2008-10-14 Thread Richard Hoberman
Hi Marcel I'd highly recommend ready Richardson's 'RESTful web services' if you're getting into REST. It is the key text and deals clearly with your questions. In fact, one of the key examples deals with geocord services. http://www.amazon.com/Restful-Web-Services-Leonard-Richardson/dp/05965292

Re: XmlRepresentation.internalEval

2008-10-14 Thread Richard Hoberman
I'm doing some reading and have found the following links useful: 1. Link to a free chapter on the final keyword in Robert Simmons 'Hardcore Java' (O'Reilly) together with a useful summary. http://hoskinator.blogspot.com/2006/04/hardcore-java-final-story.html 2. Brian Goetz comments on the 'fina

Re: Best practices when Implementing acceptingRepresentations?

2008-10-14 Thread Richard Hoberman
Hi Erik Erik Beeson wrote: > We use XStream to do all of our serialization, so we get to switch > between XML and JSON for free, which is really nice. I've been considering XStream so it's great to hear that it's working for you, especially regarding JSON. > Our containers end up really cluttered

Re: Best practices when Implementing acceptingRepresentations?

2008-10-14 Thread Richard Hoberman
Hi Vincent Vincent Ricard wrote: > Hi Richard, > > On my project, we have two "transport" layers (and we also provide a Java > Client): > - SOAP > - REST (which can return several representations of the same data). > > So, we used the POJO serialization/deserialization way. > Since we provide a cl

Re: Best practices when Implementing acceptingRepresentations?

2008-10-14 Thread Richard Hoberman
Hi Hugh Hugh Acland wrote: > Richard Hoberman sadalbari.com> writes: > > >> 2. POJO >> >> Deserialize representation into POJOs, directly from JSON or XML as >> appropriate. This avoids working with XML directly, but requires an >> extra data m

Best practices when Implementing acceptingRepresentations?

2008-10-13 Thread Richard Hoberman
d for Hibernate, but I want to decouple the REST layer from the business layer, so I'd have to duplicate the data model to some extent) I'd love to hear about what has worked and what hasn't worked from those who have gone before. Best regards Richard Hoberman

XmlRepresentation.internalEval

2008-10-13 Thread Richard Hoberman
pression, QName returnType) { try { return evaluate(expression, returnType); } catch(final RuntimeException e) { throw e; } catch (final Exception e) { throw new RuntimeException(e); } } Best regards Richard Hoberman P.S. What is

Re: [Solved] "The method specified in the request is not allowed for the resource identified by the request URI"

2008-10-10 Thread Richard Hoberman
t;> public Representation represent() >> >> instead of the overloaded >> >> public Representation represent(Variant variant) >> >> (the difference being the variant argument). >> >> The Resource class calls the overloaded version, which will return a >> null representation if you haven't overridden it. >> >> I spent quite a bit of time debugging this so this a heads up for others. >> >> Richard Hoberman

[Solved] "The method specified in the request is not allowed for the resource identified by the request URI"

2008-10-09 Thread Richard Hoberman
return a null representation if you haven't overridden it. I spent quite a bit of time debugging this so this a heads up for others. Richard Hoberman