Hi, Thanks again for the prompt reply.
> Hi Boris, > > Overriding doInit() method is easier as you don't need to make the > super.init() call and in addition if anything goes wrong, the doCatch() > will be invoked. Ok, thanks. > Regarding the broken pipe, I'm wondering it this isn't due to the ranged > request. Have you tried a straight/non-ranged HTTP call from curl or > another HTTP client? If the FileRepresentaton doesn't implement a range request, that'll break it. I believe Chrome does range requests while some other browsers (e.g. Mozilla) don't. It did work with curl so it must be comething related with the interaction with Chrome. Are there any docs, even unofficial, wikis or something that I could use as a starting point to implement a representation that supports range requests and whatever else is needed to make this work? > The idea to prevent direct access to header is not really to be more > general than HTTP, but rather to expose HTTP semantics as a Java API. This > is an aspect we might reconsider, especially for extension headers. Ok, but I think that addHeader static utility method could create the Series<Header> attribute in the request itself. Cause one can find addHeader in the APIs and say "Ah, I can try that", but it's much harder to figure out that you are supposed to add an attribute to the request before that, especially since in the servlet API for example, attributes are an application thing only. Cheers, Boris > Best regards, > Jerome > > > > 2013/6/15 Borislav Iordanov <boris at miamidade dot gov> > > > Hi Jerome, > > > > Thanks a lot for your reply, replacing the handle() method by an > > implementation of get() yielded a NullPointerException in the > > ServerResource.handle implementation. It turned out it was because I'm also > > overriding the 'init' method in order to get to the request and response > > objects, as I read somewhere in the docs that I should do. Commenting out > > my overriding of init or calling super.init solved the NPE. I also read > > somewhere on the restlet website that "to intercept init, I can override > > doInit" which I didn't do because I didn't want to "intercept" anything. I > > only want to get a reference to me request and response objects. > > > > The broken pipe exception remains. The client is Chrome Version > > 27.0.1453.110 on Ubuntu, as I mentioned via an HTML <embed> tag generally > > used for videos. Here is the info that get be gather from Chrome dev tools > > for that particular request. Note that I did try setting the Content-Length > > header explicitly. > > > > Request URL:http://localhost:8182/show > > Request Method:GET > > Status Code:206 Partial Content > > Request Headersview source > > Accept:text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 > > Accept-Encoding:gzip,deflate,sdch > > Accept-Language:en-US,en;q=0.8 > > Connection:keep-alive > > Cookie:__atuvc=12%7C5%2C0%7C6%2C0%7C7%2C0%7C8%2C2%7C9; > > vctk=1e66b965-3619-403f-b22a-2281faed2977; > > user=20657493-763c-4109-805d-48de04f4317d > > Host:localhost:8182 > > If-Range:Wed, 17 Apr 2013 04:35:52 GMT > > Range:bytes=120832-120832 > > Referer:http://localhost:8182/ > > User-Agent:Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like > > Gecko) Chrome/27.0.1453.110 Safari/537.36 > > Response Headers > > HTTP/1.1 206 Partial Content > > Content-Length: 1 > > Content-Range: bytes 120832-120832/8973447 > > Content-Type: video/mp4 > > Last-Modified: Wed, 17 Apr 2013 04:35:52 GMT > > Date: Sat, 15 Jun 2013 17:38:56 GMT > > Accept-Ranges: bytes > > Server: Restlet-Framework/2.1.2 > > > > Final note: it took my a while to find out how to add header to an HTTP > > response. I understand that Restlet aims to be more general than HTTP, but > > one has to assume HTTP is the overwhelming majority of use cases. I would > > suggest that a call to: > > > > HttpResponse.addHeader(....) > > > > should lead to a NullPointerException, but rather automatically create the > > header "Series" in the response if they are not there. > > > > Thanks again! > > Boris > > > > ------------------------------------------------------ > > > > http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=3058179 > > ------------------------------------------------------ http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=3058275

