Re: 2.0snapshot Encoder.setMinimumSize broken
Hello Guido, I've set up a sample app (served by the jetty connector) where an instance of a JsonRepresentation is instantiated with a string (456 characters). I've got also a GWT client app served by a Directory Restlet which calls the target resource, and in both cases there is no missing characters. Did you try with the current snapshot? Did you try to simply send a StringRepresentation instead of a JsonRepresentation? Best regards, Thierry Boileau Hello, sorry for being so unspecific. I use a SE component with Jetty, the client is using the GWT edition. I tested with current versions of FF, Safari and Chrome. If the issue occurs they all show one or two characters missing at the end of a json string. Maybe with this small test case it becomes reproducable: public class Encoder extends org.restlet.engine.application.Encoder { public Encoder(final Context context) { super(context); setMinimumSize(400); } @Override public void afterHandle(final Request request, final Response response) { if (response.isEntityAvailable()) { final Representation entity = response.getEntity(); try { System.out.println(entity : + entity.getText()); } catch (final IOException e) { } System.out.println(entity size : + entity.getSize()); } super.afterHandle(request, response); } } I test with a json rep that has a size of 317. The JsonRepresentation is created from a String that is built from an LDAP response or is taken out of a self-implemented cache directly. On the console I see entity : {response:{status:0,startrow:0,totalRows:1,endrow:1,data:[{id: ... }]}} entity size : 317 The string is a valid json. In a SF client the web inspector reports: Accept-Ranges:bytes Cache-Control:max-age=3600 Content-Length:317 Content-Type:application/json; charset=UTF-8 Date:Tue, 15 Dec 2009 11:47:34 GMT Expires:Tue, 15 Dec 2009 12:47:34 GMT Server:Restlet-Framework/2.0snapshot Vary:Accept-Charset, Accept-Encoding, Accept-Language, Accept But the content ends with ] the final }} are missing. Hence, I receive invalid data. Firebug on FF 355 reports the same. Changing the test code to setMinimalSize(300) I get the same correct console output and the web inspector reports: Accept-Ranges:bytes Cache-Control:max-age=3600 Content-Encoding:gzip Content-Type:application/json; charset=UTF-8 Date:Tue, 15 Dec 2009 11:53:01 GMT Expires:Tue, 15 Dec 2009 12:53:01 GMT Server:Restlet-Framework/2.0snapshot Transfer-Encoding:Identity Vary:Accept-Charset, Accept-Encoding, Accept-Language, Accept The content is correct. It seems that piping a json rep through the encoder without encoding may corrupt it. Best regards, Guido Schmidt -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2431439
Re: need some help with my project design
Hello Duong, 1) Whether the Restlet client has the Same Server Origin (SSO) restriction as with JavaSript? Actually, this is at the end pure javascript code, so the restriction applies plainly. see http://code.google.com/p/google-web-toolkit-doc-1-5/wiki/FAQ_SOP 2) If there is SSO restriction as in the case of JavaScript, are there facilities to manage request/response from the client to different servers to make sure that the response coming from its request? I'm sorry, I'm not sure to fully understand your question. Same as the server to make sure that the request comes from legitimate clients? Since the server exposes resources to the whole Web, I suppose you are talking about the authentication topic. You want the server to check that the incoming request comes from an authenticated client. It can use one of the available authentication mechanism such as HTTP_BASIC, HTTP_DIGEST, HTTP_BASIC+HTTPS, cookies, etc. Best regards, Thierry Boileau Thanks Duong Batien DBGROUPS and BudhNet On Thu, 2009-12-17 at 09:38 +0100, Thierry Boileau wrote: Hello Robert, Is restlet appropriate for this needs? yes, as any other kind of server! How would you realize the communication between Client (Javascript) and Server (Java) with the help of restlet? Ajax, surely. When the user click on the load button, the second frame is refreshed and the URL of the target page is sent to the server resource by the ajax client (which is better than sending the whole document). The targeted resource retrieves the HTML page (which can be tidied using *http://tidy.sourceforge.net http://tidy.sourceforge.net/). The server resource then returns data (rdf or xml, or json, etc) to the ajax client in order to refresh the main frame. *So, one server resource either accepting GET request (with a query parameter that contains the target URI), or accepting POST requests (with the target URI in the body). It returns either RDF, XML, etc according to the client preferences. Best regards, Thierry Boileau Hey! I want to develop a webapplication with the following functionality: 0) overview: http://dl.dropbox.com/u/1266822/overview.jpg 1) The html,css,javascript content is delivered by the server. 2) The page consists of 2 frames. the second one loads the webpages the user wants to open. 3) The server receives the DOM of the loaded page. 4) The client receives data in the form of rdf or xml. Is restlet appropriate for this needs? How would you realize the communication between Client (Javascript) and Server (Java) with the help of restlet? Would be really nice if you could give me a short overview of what I have to take care of. Thanks in advance, Robert -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2430835 -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2431075 -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2431201 -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2431515
[JOB] Developer Needed in New York
Hi all, I hope no one minds me posting this here. We're a web application design and development firm in New York, and we've got some big new opportunities coming up in 2010. We're looking for experienced, dynamic, creative generalists, with a strong background in web application development, particularly with Restlet, to start soon. Please note: this is an on-site, full-time, long-term position. If you're interested, please see our job posting here: http://jobs.37signals.com/jobs/5891 and send me a SHORT note introducing yourself and describing how you'd be a good fit for the position. PLEASE don't reply to the list, unless it's to lambast me for spamming. Thanks, and Happy Hanukkah, Merry Christmas, Happy Winter, etc! Avi -- Avi Flax » Partner » Arc90 » http://arc90.com ➙ Have you tried Kindling‽ http://kindlingapp.com -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2431516
Re: need some help with my project design
Hi, I suspect you are using the 2.0m5 or under version of the Restlet framework. Is it right? In this case, can you test with the 2.0 m6? best regards, Thierry Boileau Hey Thierry, thanks for your answer! I tried to receive the text from the hello world example with ajax. The js code (using jquery): $.ajax({ type: GET, url: myurl/hello, data: , success: function(data){ $(#ajaxcontent).html(data); } }); But it seems to be a difference between an ajax get request and the browser get request? My console shows this for the browser request: 9000 GET /hello - 200 12 - 2 And this for the ajax request: 9000 OPTIONS /hello - 405 402 - 0 How can I fix this? :) Hello Robert, Is restlet appropriate for this needs? yes, as any other kind of server! How would you realize the communication between Client (Javascript) and Server (Java) with the help of restlet? Ajax, surely. When the user click on the load button, the second frame is refreshed and the URL of the target page is sent to the server resource by the ajax client (which is better than sending the whole document). The targeted resource retrieves the HTML page (which can be tidied using *http://tidy.sourceforge.net http://tidy.sourceforge.net/). The server resource then returns data (rdf or xml, or json, etc) to the ajax client in order to refresh the main frame. *So, one server resource either accepting GET request (with a query parameter that contains the target URI), or accepting POST requests (with the target URI in the body). It returns either RDF, XML, etc according to the client preferences. Best regards, Thierry Boileau Hey! I want to develop a webapplication with the following functionality: 0) overview: http://dl.dropbox.com/u/1266822/overview.jpg 1) The html,css,javascript content is delivered by the server. 2) The page consists of 2 frames. the second one loads the webpages the user wants to open. 3) The server receives the DOM of the loaded page. 4) The client receives data in the form of rdf or xml. Is restlet appropriate for this needs? How would you realize the communication between Client (Javascript) and Server (Java) with the help of restlet? Would be really nice if you could give me a short overview of what I have to take care of. Thanks in advance, Robert -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2430835 -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2431563
Re: need some help with my project design
On Fri, 2009-12-18 at 17:04 +0100, Thierry Boileau wrote: Hello Duong, 1) Whether the Restlet client has the Same Server Origin (SSO) restriction as with JavaSript? Actually, this is at the end pure javascript code, so the restriction applies plainly. see http://code.google.com/p/google-web-toolkit-doc-1-5/wiki/FAQ_SOP Yes, this is what I referred to: Same Origin Policy (SOP) of browser. I have explored GWT StockWatcher for cross-site JSONP request/response. 2) If there is SSO restriction as in the case of JavaScript, are there facilities to manage request/response from the client to different servers to make sure that the response coming from its request? I'm sorry, I'm not sure to fully understand your question. In that cross-site mashup, one needs a facility to store requested callbacks so it can cancel the no-response callback after certain time lapsed and identify the callback actually coming from its request. This may require a facility more sophisticated than just a HashMap of callbacks as shown in GWT StockWatcher. I wonder if GWT Reslet client has that facility in place?. Same as the server to make sure that the request comes from legitimate clients? Since the server exposes resources to the whole Web, I suppose you are talking about the authentication topic. You want the server to check that the incoming request comes from an authenticated client. It can use one of the available authentication mechanism such as HTTP_BASIC, HTTP_DIGEST, HTTP_BASIC+HTTPS, cookies, etc. It is much more complicated than that. When the server serves a resource, it identifies the request with a user profile and its unique token. If the user has not been authenticated, then guest Id with location may be in the user profile. When user is authenticated, the profile is changed accordingly. User second request and/or client state maintained at the browser always has the server token so the server know the client state, and if required can be directed to Authentication process. I wonder if Restlet and/or anyone has explored this area working with GAE. I am also exploring Google Wave where Wave robots are at the Web Server served by servlet urls. The web server uses Reslet for resource Request/Response to be integrated with Wave server. Any comment in this area is appreciated. Thanks Duong BaTien DBGROUPS and BudhNet Best regards, Thierry Boileau Thanks Duong Batien DBGROUPS and BudhNet On Thu, 2009-12-17 at 09:38 +0100, Thierry Boileau wrote: Hello Robert, Is restlet appropriate for this needs? yes, as any other kind of server! How would you realize the communication between Client (Javascript) and Server (Java) with the help of restlet? Ajax, surely. When the user click on the load button, the second frame is refreshed and the URL of the target page is sent to the server resource by the ajax client (which is better than sending the whole document). The targeted resource retrieves the HTML page (which can be tidied using *http://tidy.sourceforge.net http://tidy.sourceforge.net/). The server resource then returns data (rdf or xml, or json, etc) to the ajax client in order to refresh the main frame. *So, one server resource either accepting GET request (with a query parameter that contains the target URI), or accepting POST requests (with the target URI in the body). It returns either RDF, XML, etc according to the client preferences. Best regards, Thierry Boileau Hey! I want to develop a webapplication with the following functionality: 0) overview: http://dl.dropbox.com/u/1266822/overview.jpg 1) The html,css,javascript content is delivered by the server. 2) The page consists of 2 frames. the second one loads the webpages the user wants to open. 3) The server receives the DOM of the loaded page. 4) The client receives data in the form of rdf or xml. Is restlet appropriate for this needs? How would you realize the communication between Client (Javascript) and Server (Java) with the help of restlet? Would be really nice if you could give me a short overview of what I have to take care of. Thanks in advance, Robert -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2430835 -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2431075 -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2431201 -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2431515 -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2431626