Re: Starting my own threads from a Restlet request

2010-01-14 Thread Thierry Boileau
Hi Marc, So, my first question is whether Restlet supports the ability to write multi-threaded representation methods in a ServerResource? I think so. You may be aware that each incoming request is handled by a brand new instance of the ServerResource class. I ask, because I've tried it and

Re: How to get HttpServletResponse object in restlet

2010-01-14 Thread Thierry Boileau
Hi Sam, when handling a Request/Response pair in the context of a servlet container, the outputStream of the response is the one of the HttpServletResponse object. In the case of the OutputRepresentation, any subclasses are required to override the write(OutputStream) method, where the given

Re: Restlet client and setting the request header date

2010-01-14 Thread Thierry Boileau
Hi Garry, I'm afraid not. This value is set with a new Date() value just before the header is written... The onContinue was thought to be called before the entity is sent, after the headers were written. I say was, because it has been removed since no clear use case emerged. Best regards,

Re: Starting my own threads from a Restlet request

2010-01-14 Thread Marc Limotte
Yes, I am working on a Mac. Thanks for the pointer to this bug id. My multi-threaded request seems to work otherwise. I'm using ExecutorCompletionService and ThreadPoolExecutor from the Java Concurrency package. And nice work on the Restlet framework, I was able to get something up and going in

RE: Re: servlet mapping question

2010-01-14 Thread webpost
ok no problem: - localhost/MyApp/ - returns index.html of the web content directory - localhost/MyApp/*relRef* - MyResourceA (does something with the relative reference *relRef* and return a html representation) - localhost/MyApp/restlet/* - MyResourceB (returns a json representation) best

Re: Starting my own threads from a Restlet request

2010-01-14 Thread Tim Peierls
On Thu, Jan 14, 2010 at 11:24 AM, Marc Limotte mslimo...@gmail.com wrote: My multi-threaded request seems to work otherwise. I'm using ExecutorCompletionService and ThreadPoolExecutor from the Java Concurrency package. One thing to be careful of, as Thierry hinted, is that a ServerResource

not sure if null identifier is user error or bug

2010-01-14 Thread Taylor Cowan
I'm getting a null identifier using the Restlet client Response res = client.post(http://localhost:8080/nodes;, r); Representation rep = res.getEntity(); System.out.println(rep.getIdentifier()); System.out.println(rep.getSize()); System.out.println(rep.getMediaType()); results in null, 12, and

RE: Re: servlet mapping question

2010-01-14 Thread webpost
thank you! i already tried this and it didn't work. but now i changed the following: TemplateRoute mainroute = router.attach(/, new Directory(getContext(), war:///)); mainrouteroute.setMatchingMod​e(Template.MODE_EQUALS); and this works :)

Re: Restlet client and setting the request header date

2010-01-14 Thread Garry Turkington
Hi again Thierry, One other question re the removal of the onContinue callbacks. In the snapshot code I was trying to use the interim response code to support an Expect/CONTINUE interaction. I wasn't getting the behaviour I expected though on reflection I wasn't convinced the client I had was

Re: Restlet client and setting the request header date

2010-01-14 Thread Garry Turkington
Hi Thierry, Thanks for this response, even if it does make my life more complicated! What I'm building is basically a clone of Amazon's S3. On the server side this has been more or less fine using Restlet -- modulo the issues I've previously raised re the AuthenticationHelper and support for