HTTPS File Upload Problem
Hi Everyone, I'm facing a strange problem !! .. I used to upload files to my Restlet normally when i was using HTTP ... everything was working well till i switched to HTTPS (the saga began) ... When i upload files (same manner, same files with same sizes) sometimes they do upload and many times they don't ... Moreover, i used to redirect to another Restlet after the file's being uploaded and it works although file was not uploaded !! so strange right ? ... i didn't get HTTP error codes, no Exceptions, nothing ... Everything works like charm except for my file not being uploaded (most of the time, sometimes it does)... i saw old posts on javaranch with hopeless or no replies I really don't understand why this happens ?, so if anyone got an idea let us share our thoughts about it may be we can get to something... Thanks All the best... -- View this message in context: http://n2.nabble.com/HTTPS-File-Upload-Problem-tp1693078p1693078.html Sent from the Restlet Discuss mailing list archive at Nabble.com. -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=990428
Re: Router class not matching a URI with corresponding Template correctly
Hi Prashant, the problem is that the type of the variable is Variable.TYPE_URI_ALL which means that it matches every characters. So /language/test/12345/java/ can match /language/{var1}/{var2}/ with var1 variable valuated to test/12345 and var2 to java. By default, a variable matches a URI segment. Could you explain a little bit more your use case? Coming back to your first mail, you told us that /language/12345/java/ cannot match /language/{var1}/{var2}/. But why? What are the rules applied to each variables? Best regards, Thierry Boileau -- Restlet ~ Core developer ~ http://www.restlet.org Noelios Technologies ~ Co-founder ~ http://www.noelios.com Hi Thierry, Thank you very much for your response. Whatever you explained its fine. But problem in my application is, I have to write code to match the incoming formatted URI with a template(stored in a collection). I am using Template.match(String) method in my code to match formatted URI with a template pattern. Now, what this match method is doing it is returning two matches. E.g. /language/{var1}/{var2}/ /language/{var1}/{var2}/java/ If i send a request to my application with URI /language/test/12345/java/ and try to match using Template.match() method, it is returning two results. Code is something like: Reference URI = request.getResourceRef(); Router router = (Router) getNext(); RouteList list = router.getRoutes(); IteratorRoute itr = list.listIterator(); while(itr.hasNext()) { Route route = itr.next(); route.getTemplate().getDefaultVariable().setType(Variable.TYPE_URI_ALL); route.getTemplate().setMatchingMode(Template.MODE_EQUALS); if(route.getTemplate().match(URI.getRemainingPart())!=-1) { logger.debug(Match found:); } } The above given code logs Match found: two times for both the URIs. Thanks Prashant Hello prashant, you can specify the type of a single variable as follow: Route route = router.attach(/language/{var1}/{var2}/, restlet1); route.getTemplate().getVariables().put(var1, new Variable(Variable.TYPE_ALPHA)); I also send you a sample application that illustrates this. best regards, Thierry Boileau Hi All, I am new to Restlets even after working for around last 8 months on restlets. :-) I am facing a problem with my application. Description is as follows: In my application class I have two REST URIs as given below: (1st) /language/{var1}/{var2}/ (2nd) /language/{var1}/{var2}/java/ I have also set Default matching mode of the router to MODE_EQUALS. Now, if I test second URI with not providing value for one of the varibales e.g. /language/12345/java/ (Note: value for var1 is missing in this URI) My Router is matching this URI with first URI template and executes restlet class assgined to first URI i.e /language/{var1}/{var2}/ Ideally if i have set matching mode to MODE_EQUALS for router it should show a message server has not found anything matching requested URI with response code 404. Please help me coming out of this problem. I have also tries with changin type of default varibale but no luck. Thanks in advance. Prashant -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=989509 -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=990460
Re: question about spring example and uri extension parsing/best practices.
Hi Matt, The next and more important REST and url extension and return format? I am in the quandry of deciding to do my rest API via extension or an 'optional' argument. I have included a snippit of my spring config below... i.e. 1) myapi/v1/company/1.xml (or rss, json) bla bla bla 2) a) myapi/v1/company/1 - default xml b) myapi/v1/company/1format=xml c) myapi/v1/company/1/format=xml 2a and 2c works right out of the box so to speak. However 1 and 2b break since they pass in 1.xml and 1format=xml in the company {id} param. I would like to make my urls at least work for 2b or possibly 1 as well. I was not sure if I had to define some special regex in my routes for each pattern or if there was a global way to do cush filtering/url munging with restlet. Or if I had to roll my own. My end goal is to switch the accepted varient type based on either uri extension or optional format=XXX but get some strange behaviour in the routing itself. The protocoll HTTP has content negotiation included. Normally you could use it via the appropriate http headers. Restlet supports this also via url parameters, so you are not required to implement it yourself. You could use the TunnelService of the application for it. See the methods on Application.getTunnelService.set*() and their javadoc. So it's easy to realize you proposal 2b. The TunnelService supports also the content negotiation by file extension, as you proposed in 1). So, it's all in Restlet, just use it. Use Application.getTunnelService().setExtensionTunnel(true). http://www.restlet.org/documentation/1.1/tutorial#part12 shows, how to evaluate the content negotiation in the server code. best regards Stephan ___ Sensationsangebot verlängert: WEB.DE FreeDSL - Telefonanschluss + DSL für nur 16,37 Euro/mtl.!* http://dsl.web.de/?ac=OM.AD.AD008K15039B7069a -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=990476
Re: question about spring example and uri extension parsing/best practices.
Hi matt, I have two questions. One is where to find a complete example of the spring-restlet integration. I tried the cvs repo on the wiki and for some reason could never get there?!? Did you have a loook at this page = http://wiki.restlet.org/docs_1.1/13-restlet/28-restlet/70-restlet.html ? The next and more important REST and url extension and return format? I am in the quandry of deciding to do my rest API via extension or an 'optional' argument. I have included a snippit of my spring config below... In order to separate the concerns, you can setup a filter either in front of your application or inside the application. The aim of this filter could be to make the incoming URIs converge to your single URI pattern (/company/{id}) and update the client preferences according to the incoming media type. It parses the end of the request.resourceRef, update it (you can also use the request.originalRef attribute in order to keep the original URI), and update the request.clientInfo.acceptedMediaTypes list: clientInfo.getAcceptedMediaTypes().add(new PreferenceMediaType(application.getMetadataService().getMetadata(extension))); This instruction uses the metadata service of the applicaiton in order to get the MediaType that corresponds to the examined extension. I hope this will help you. Best regards, Thierry Boileau -- Restlet ~ Core developer ~ http://www.restlet.org Noelios Technologies ~ Co-founder ~ http://www.noelios.com i.e. 1) myapi/v1/company/1.xml (or rss, json) bla bla bla 2) a) myapi/v1/company/1 - default xml b) myapi/v1/company/1format=xml c) myapi/v1/company/1/format=xml 2a and 2c works right out of the box so to speak. However 1 and 2b break since they pass in 1.xml and 1format=xml in the company {id} param. I would like to make my urls at least work for 2b or possibly 1 as well. I was not sure if I had to define some special regex in my routes for each pattern or if there was a global way to do cush filtering/url munging with restlet. Or if I had to roll my own. My end goal is to switch the accepted varient type based on either uri extension or optional format=XXX but get some strange behaviour in the routing itself. My same was pulled from the spring sample and works wonderully minus this extension parsing issue. entry key=/company/{id} bean class=org.restlet.ext.spring.SpringFinder lookup-method name=createResource bean=companyResource / /bean /entry // this would work for xml but I do not want to do this for // every extension entry key=/company/{id}.xml Thanks in advance.. matt -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=990197 -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=990489
RE: Re: Restlet 1.1 HTTP digest support
Thanks a lot for pointer. I tried to use the code provided. But it did not work. For both requests made in client i got 401 response. I have a query though.. where do we speficy the authentication is HTTP digest on server side? Dont we need to specify that in the guard? Following is the code for guard - // Use the basic guard Guard guard = new Guard(component.getContext().createChildContext(), realm, baseUris, serverKey); // Load a single static login/secret pair. guard.getSecrets().put(login, secret.toCharArray()); guard.setNext(restlet); Here, nowhere we specify the authentication type... Regards, -Vidya -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=990521
RE: Re: Router class not matching a URI with corresponding Template correctly
Hi Thierry, Thanks for response. At this point of time please ignore my first mail. Currently My use case is something like the one given below: I have a map object containing all the URIs to be attached in router. Entries in this map are like: map.put(/language/{var1}/{var2}/java/,com.mypackage.Restlet1); map.put(/language/{var1}/{var2}/,com.mypackage.Restlet2); in my application class's createRoot() method I iterate over this map and attach each entry in router. Now,I have a filter class and In beforeHandle() method of that class I am trying to iterate over each template from Router list and want to find out the exact matching template for the formatted URI string from request i.e. /language/temp/12345.12345/java/ To achieve this I have written the code as given in my previous mail. But the code in previous mail does not match with exact URI but it matches with both the entries of map. So, my question is how should I modify my code to get only one entry i.e. /language/{var1}/{var2}/java/ for request /language/temp/12345.12345/java/ and not /language/{var1}/{var2}/ Hope it clears. Thanks Prashant Hi Prashant, the problem is that the type of the variable is Variable.TYPE_URI_ALL which means that it matches every characters. So /language/test/12345/java/ can match /language/{var1}/{var2}/ with var1 variable valuated to test/12345 and var2 to java. By default, a variable matches a URI segment. Could you explain a little bit more your use case? Coming back to your first mail, you told us that /language/12345/java/ cannot match /language/{var1}/{var2}/. But why? What are the rules applied to each variables? Best regards, Thierry Boileau -- Restlet ~ Core developer ~ http://www.restlet.org Noelios Technologies ~ Co-founder ~ http://www.noelios.com Hi Thierry, Thank you very much for your response. Whatever you explained its fine. But problem in my application is, I have to write code to match the incoming formatted URI with a template(stored in a collection). I am using Template.match(String) method in my code to match formatted URI with a template pattern. Now, what this match method is doing it is returning two matches. E.g. /language/{var1}/{var2}/ /language/{var1}/{var2}/java/ If i send a request to my application with URI /language/test/12345/java/ and try to match using Template.match() method, it is returning two results. Code is something like: Reference URI = request.getResourceRef(); Router router = (Router) getNext(); RouteList list = router.getRoutes(); IteratorRoute itr = list.listIterator(); while(itr.hasNext()) { Route route = itr.next(); route.getTemplate().getDefaultVariable().setType(Variable.TYPE_URI_ALL); route.getTemplate().setMatchingMode(Template.MODE_EQUALS); if(route.getTemplate().match(URI.getRemainingPart())!=-1) { logger.debug(Match found:); } } The above given code logs Match found: two times for both the URIs. Thanks Prashant Hello prashant, you can specify the type of a single variable as follow: Route route = router.attach(/language/{var1}/{var2}/, restlet1); route.getTemplate().getVariables().put(var1, new Variable(Variable.TYPE_ALPHA)); I also send you a sample application that illustrates this. best regards, Thierry Boileau Hi All, I am new to Restlets even after working for around last 8 months on restlets. :-) I am facing a problem with my application. Description is as follows: In my application class I have two REST URIs as given below: (1st) /language/{var1}/{var2}/ (2nd) /language/{var1}/{var2}/java/ I have also set Default matching mode of the router to MODE_EQUALS. Now, if I test second URI with not providing value for one of the varibales e.g. /language/12345/java/ (Note: value for var1 is missing in this URI) My Router is matching this URI with first URI template and executes restlet class assgined to first URI i.e /language/{var1}/{var2}/ Ideally if i have set matching mode to MODE_EQUALS for router it should show a message server has not found anything matching requested URI with response code 404. Please help me coming out of this problem. I have also tries with changin type of default varibale but no luck. Thanks in advance. Prashant -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=989509 -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=990487
Re: Restlet 1.1 HTTP digest support
Hello Vidya, actually in Restlet 1.1, this constructor is dedicated to the support of the DIGEST scheme (see the javadocs http://www.restlet.org/documentation/1.1/api/org/restlet/Guard.html). Thanks for the report, I will a look at the sample code. best regards, Thierry Boileau Thanks a lot for pointer. I tried to use the code provided. But it did not work. For both requests made in client i got 401 response. I have a query though.. where do we speficy the authentication is HTTP digest on server side? Dont we need to specify that in the guard? Following is the code for guard - // Use the basic guard Guard guard = new Guard(component.getContext().createChildContext(), realm, baseUris, serverKey); // Load a single static login/secret pair. guard.getSecrets().put(login, secret.toCharArray()); guard.setNext(restlet); Here, nowhere we specify the authentication type... Regards, -Vidya -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=990521 -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=990566
RE: Re: Restlet 1.1 HTTP digest support
Really sorry. There were errors in my copy paste. Correcting them did make it work. Thanks merry X'mas. -Vidya -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=990527
SSL in restlet
Hi all, I tried using a trial SSL certificate for securing my test application. I got following error - INFO: Starting the Grizzly [HTTP] server java.io.FileNotFoundException: C:\Documents and Settings\Admin\.keystore (The system cannot find the file specified) at java.io.FileInputStream.open(Native Method) at java.io.FileInputStream.init(Unknown Source) at java.io.FileInputStream.init(Unknown Source) at com.noelios.restlet.ext.grizzly.HttpsServerHelper.configure(HttpsServerHelper.java:155) at com.noelios.restlet.ext.grizzly.GrizzlyServerHelper.start(GrizzlyServerHelper.java:102) at org.restlet.Server.start(Server.java:383) at org.restlet.Component.startServers(Component.java:1233) at org.restlet.Component.start(Component.java:1194) at restservice.InputDataWebService.main(InputDataWebService.java:37) Here is my sample code - import java.io.File; import org.restlet.Component; import org.restlet.VirtualHost; import org.restlet.data.Protocol; public class InputDataWebService { public static void main(String[] args) { try { // Create a new Component. Component component = new Component(); // Add a new HTTP server listening on port 8182. component.getServers().add(Protocol.HTTP, 8182); component.getServers().add(Protocol.HTTPS, 8183); /* arredocenter.com */ VirtualHost host = new VirtualHost(component.getContext()); host.setHostDomain(www.metadata.com|metadata.com|metadata); host.attach(new InputDataApplication(component.getContext())); component.getHosts().add(host); // Update component's context with keystore parameters. File keystoreFile = new File(D:\\metadata.crt, keystore); component.getContext().getParameters().add(keystorePath, keystoreFile.toURI().toASCIIString()); component.getContext().getParameters().add(keystorePassword, vidya.vadke); component.getContext().getParameters().add(keyPassword, vidya.vadke); // Start the component. component.start(); } catch (Exception e) { // Something is wrong. e.printStackTrace(); } } } Can anyone tell me what am i missing here? -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=990522
Re: Restlet 1.1 HTTP digest support
Hello Vidya, I 've tested successfully the sample code. Could you tell us what is the content of your classpath, especially what Restlet extension (grizzly, simple, jett, etc) are you using? best regards, Thierry Boileau Thanks a lot for pointer. I tried to use the code provided. But it did not work. For both requests made in client i got 401 response. I have a query though.. where do we speficy the authentication is HTTP digest on server side? Dont we need to specify that in the guard? Following is the code for guard - // Use the basic guard Guard guard = new Guard(component.getContext().createChildContext(), realm, baseUris, serverKey); // Load a single static login/secret pair. guard.getSecrets().put(login, secret.toCharArray()); guard.setNext(restlet); Here, nowhere we specify the authentication type... Regards, -Vidya -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=990521 -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=990583
Re: SSL in restlet
Hi, The missing file C:\Documents and Settings\Admin\.keystore contains data for the the encryption. Take a look at http://wiki.restlet.org/docs_1.1/13-restlet/27-restlet/46-restlet/213-restlet.html best regards Stephan Hi all, I tried using a trial SSL certificate for securing my test application. I got following error - INFO: Starting the Grizzly [HTTP] server java.io.FileNotFoundException: C:\Documents and Settings\Admin\.keystore (The system cannot find the file specified) at java.io.FileInputStream.open(Native Method) at java.io.FileInputStream.init(Unknown Source) at java.io.FileInputStream.init(Unknown Source) at com.noelios.restlet.ext.grizzly.HttpsServerHelper.configure(HttpsServerHelper.java:155) at com.noelios.restlet.ext.grizzly.GrizzlyServerHelper.start(GrizzlyServerHelper.java:102) at org.restlet.Server.start(Server.java:383) at org.restlet.Component.startServers(Component.java:1233) at org.restlet.Component.start(Component.java:1194) at restservice.InputDataWebService.main(InputDataWebService.java:37) Can anyone tell me what am i missing here? ___ Täglich 1.000.000 Euro gewinnen! Jetzt kostenlos WEB.DE MillionenKlick spielen! https://millionenklick.web.de/?mc=m...@footer.mklick@home -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=990605
Re: SSL in restlet
Hi vidya vadke, Make sure your keystore file exists at that path C:\Documents and Settings\Admin\.keystore ... anyway for me i use this: SeriesParameter parameters = server.getContext().getParameters(); parameters.add(sslContextFactory, com.noelios.restlet.ext.ssl.PkixSslContextFactory); parameters.add(keystorePath,add_keystore_file_path_here)); parameters.add(keystorePassword, vidya.vadke); parameters.add(keyPassword, vidya.vadke); parameters.add(keystoreType, PKCS12); // Start the component. component.start(); instead of: // Update component's context with keystore parameters. File keystoreFile = new File(D:\\metadata.crt, keystore); component.getContext().getParameters().add(keystorePath, keystoreFile.toURI().toASCIIString()); component.getContext().getParameters().add(keystorePassword, vidya.vadke); component.getContext().getParameters().add(keyPassword, vidya.vadke); // Start the component. component.start(); Hope this helps vidya vadke wrote: Hi all, I tried using a trial SSL certificate for securing my test application. I got following error - INFO: Starting the Grizzly [HTTP] server java.io.FileNotFoundException: C:\Documents and Settings\Admin\.keystore (The system cannot find the file specified) at java.io.FileInputStream.open(Native Method) at java.io.FileInputStream.init(Unknown Source) at java.io.FileInputStream.init(Unknown Source) at com.noelios.restlet.ext.grizzly.HttpsServerHelper.configure(HttpsServerHelper.java:155) at com.noelios.restlet.ext.grizzly.GrizzlyServerHelper.start(GrizzlyServerHelper.java:102) at org.restlet.Server.start(Server.java:383) at org.restlet.Component.startServers(Component.java:1233) at org.restlet.Component.start(Component.java:1194) at restservice.InputDataWebService.main(InputDataWebService.java:37) Here is my sample code - import java.io.File; import org.restlet.Component; import org.restlet.VirtualHost; import org.restlet.data.Protocol; public class InputDataWebService { public static void main(String[] args) { try { // Create a new Component. Component component = new Component(); // Add a new HTTP server listening on port 8182. component.getServers().add(Protocol.HTTP, 8182); component.getServers().add(Protocol.HTTPS, 8183); /* arredocenter.com */ VirtualHost host = new VirtualHost(component.getContext()); host.setHostDomain(www.metadata.com|metadata.com|metadata); host.attach(new InputDataApplication(component.getContext())); component.getHosts().add(host); // Update component's context with keystore parameters. File keystoreFile = new File(D:\\metadata.crt, keystore); component.getContext().getParameters().add(keystorePath, keystoreFile.toURI().toASCIIString()); component.getContext().getParameters().add(keystorePassword, vidya.vadke); component.getContext().getParameters().add(keyPassword, vidya.vadke); // Start the component. component.start(); } catch (Exception e) { // Something is wrong. e.printStackTrace(); } } } Can anyone tell me what am i missing here? -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=990522 -- View this message in context: http://n2.nabble.com/SSL-in-restlet-tp1693602p1693683.html Sent from the Restlet Discuss mailing list archive at Nabble.com. -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=990615
Re: HTTPS File Upload Problem
Hi Mohamed ... which Connector are you using? (Jetty, Simple, Net...) and Restlet version? I had some similar problems with Simple once, but I switched to Jetty and they went away. But Jerome and Thierry use Simple and don't seem to have these problems. On Tue, Dec 23, 2008 at 2:56 AM, Mohamed Abdel-Aziz Bayoumi mohamed@gmail.com wrote: When i upload files (same manner, same files with same sizes) sometimes they do upload and many times they don't ... -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=990661
RE: Re: question about spring example and uri extension parsing/best practices.
Thanks you guys for the response. I actually had a dumb config problem in accessing the repo so i got the spring example configs now and things seem ok. I will try exploring the tunnel service as well. Hopefully I can get everything configured through spring/servlet container with injection. We have a goal of deploying all through a servlet container with jetty or tomcat so hopefully I can get it all working there. Thanks to you guys for the help. It was a great stepping point!!! matt -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=990822
Re: HTTPS File Upload Problem
Hi Rob, Thanks to you my friend my problem was solved ... I'm using Restlet 1.1 and by mistake i's leaving all connectors in my classpath but the one that was actually used at depolyment time was Grizzly ... You pointed this out for me when you asked me which connector i'm using so i removed all of'em from my classpath and left the Simple connector alone to test and luckily my problem was solved (but don't forget that the problem still persists when using Grizzly connector) ... Thanks again Rob, All the best ... Rob Heittman wrote: Hi Mohamed ... which Connector are you using? (Jetty, Simple, Net...) and Restlet version? I had some similar problems with Simple once, but I switched to Jetty and they went away. But Jerome and Thierry use Simple and don't seem to have these problems. On Tue, Dec 23, 2008 at 2:56 AM, Mohamed Abdel-Aziz Bayoumi mohamed@gmail.com wrote: When i upload files (same manner, same files with same sizes) sometimes they do upload and many times they don't ... -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=990661 -- View this message in context: http://n2.nabble.com/HTTPS-File-Upload-Problem-tp1693078p1693946.html Sent from the Restlet Discuss mailing list archive at Nabble.com. -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=990707
RE: Simple Reference suggestion
Hi Cliff, Good suggestion. I've just committed these changes to SVN trunk: - Added Reference#toUri(), toUrl() and constructors from java.net.URI and URL instances. Best regards, Jerome Louvel -- Restlet ~ Founder and Lead developer ~ http://www.restlet.org/ http://www.restlet.org Noelios Technologies ~ Co-founder ~ http://www.noelios.com http://www.noelios.com _ De : Cliff Binstock [mailto:cliff.binst...@coyotereporting.com] Envoye : lundi 8 decembre 2008 19:56 A : discuss@restlet.tigris.org Objet : Simple Reference suggestion Another Restlet suggestion: The Reference class should definitely have a #toURI method. It should possibly also have a URI constructor. Thanks, Cliff -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=990864
RE: contributing - areas of interest
Hi Raif, Cool! * Java Bindings to XML Schemas: we already support JAXB and JiBX technologies. What would adding an extension for XMLBeans add (pros/cons)? There are many serializations technologies to consider (Castor comes to mind) so we need to be very selective in what we add to the main Restlet project. * authorization toolkit: thanks for the pointer to Tomcat Realms, I've added a comment about it in issue #505. This is definitely an area that would benefit from contributions during Restlet 1.2 development cycle! * KML/KMZ support: this might be a too application specific to fit into the main Restlet project, but you could start a dedicated open source project (for example on Google Code), that would leverage Restlet. We would be happy to point users to it and support you. Best regards, Jerome Louvel -- Restlet ~ Founder and Lead developer ~ http://www.restlet.org Noelios Technologies ~ Co-founder ~ http://www.noelios.com -Message d'origine- De : Raif S. Naffah [mailto:tig...@naffah-raif.name] Envoye : lundi 8 decembre 2008 09:05 A : discuss@restlet.tigris.org Objet : contributing - areas of interest hello there, (i'm sending this again since it does not look like it made it to the list the first time around). i'd like to contribute to this project in my free time. areas of interests which i've identified so far --and am personally interested in-- are: * Java Bindings to XML Schemas: replace XML parsing with pre-generated classes (XMLBeans xmlbeans.apache.org) from published/known schemas; e.g. the parsing of the restlet.xml. * authorization toolkit: something equivalent to what is available with servlets in Apache Tomcat; see http://tomcat.apache.org/tomcat-6.0- doc/realm-howto.html. * KML/KMZ support: something beyond issue #677; more like a SPI toolkit to allow building KML files (e.g. from a CSV document). if this is of interest to the project maintainers, then pls. let me know how to proceed next. cheers; rsn -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=981057 -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=990910
RE: Running restlet/maven in Tomcat causes CCE
Hi Ian, Were you able to solve this problem? Otherwise, could you open an issue and attach a small reproducible sample (source code) to it? http://www.restlet.org/community/issues Best regards, Jerome Louvel -- Restlet ~ Founder and Lead developer ~ http://www.restlet.org Noelios Technologies ~ Co-founder ~ http://www.noelios.com -Message d'origine- De : postmas...@tigris.org [mailto:postmas...@tigris.org] Envoye : mardi 9 decembre 2008 14:28 A : discuss@restlet.tigris.org Objet : Running restlet/maven in Tomcat causes CCE I have a maven/restlet project that works just fine when I launch it with mvn jetty:run. If, however, I launch the same project, unchanged, with mvn tomcat:run, I get: [ERROR] Allocate exception for servlet PytheasRestServlet java.lang.ClassCastException: com.noelios.restlet.ext.servlet.ServerServlet cannot be cast to javax.servlet.Servlet at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1055) at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:757) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:130) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869) at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:667) at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527) at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684) at java.lang.Thread.run(Thread.java:619) I assume this is some kind of classloader problem, but I have no idea how to go about tracking it down. Anyone have any suggestions? Thanks, Ian -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=981641 -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=990916
RE: REQUEST FireFox cache control
Hi Rob, Finally I'm back in this list :-) So, you are totally right about the meaning of the transient property: nothing to do with caching. Thanks also for the nice write up about caching behaviors: I've added a link back to your post in issue #25. Caching support is definitely something high on Restlet 1.2 priority list, but I'm not too keen on changing the API in an incremental Restlet 1.1 release. I , will however make sure that Restlet 1.2 is released in time, adjusting the features scope if necessary. I'm hoping for a 1.2 M1 in January. Best regards, Jerome Louvel -- Restlet ~ Founder and Lead developer ~ http://www.restlet.org/ http://www.restlet.org Noelios Technologies ~ Co-founder ~ http://www.noelios.com/ http://www.noelios.com _ De : Rob Heittman [mailto:rob.heitt...@solertium.com] Envoye : mardi 9 decembre 2008 03:48 A : discuss@restlet.tigris.org Objet : Re: REQUEST FireFox cache control Hi Cliff, Jerome is on holiday, so I'll take a shot at this; if I'm wrong, Thierry will take a shot at me :-) I'm pretty sure that the transient property is only useful to identify entities that can only be consumed once; for example, stream-based representations. I don't think they do or are meant to influence cache behavior in any way. This RFE tracks the idea of introducing caching support to Restlet (both internally, and influencing client side cache behavior): http://restlet.tigris.org/issues/show_bug.cgi?id=25 Interesting work is scheduled to happen on this in the near future. At present, you must set the Cache-Control header directly using the non-standard header mechanism: http://www.restlet.org/documentation/1.1/api/org/restlet/data/Message.html#getAttributes() This will produce a warning, I think (unless it was turned off recently) but will get the desired effect. I was hoping to propose a patch in the 1.1 timeframe that would directly support the Cache-Control header without yet conquering the rest of RFE 25, but did not get around to it. I still think this is worth doing in a 1.1 incremental release -- it's a common, common need. http://blog.httpwatch.com/2008/10/15/two-important-differences-between-firefox-and-ie-caching/ I read this article and, while I think its technical statements are correct, it seems to have been written from the perspective that IE's behavior is per spec, which I feel it is not. http://blog.httpwatch.com/2008/10/15/two-important-differences-between-firefox-and-ie-caching/ (which is hopefully correct), FF will only respond as expected if you also set no-store. In otherwords, Cache-control: no-cache no-store. See sections 14.9.1 and 14.9.2 of the HTTP 1.1 RFC: http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9.1 no-cache will stop FF from storing the page in the disk cache for subsequent requests -- but you can still generally hit the back button to return to the page as originally seen. You must use no-store if you mean to avoid disclosure of sensitive information, not store the page anywhere including the memory cache, and to reload it on any redisplay. I feel that this behavior tracks the RFC text more accurately; IE has it wrong by not using no-store for this purpose. Depending on what you mean to happen, you should use the appropriate thing. I use no-store on pages that absolutely must not be reloaded for any reason, but generally use no-cache for good performance combined with good liveness of content. - R -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=990923
RE: Restlet way to parse uri Qyery component
Hi Leshek, If you are inside a Resource subclass, there is even a shorter short-cut! Form form = this.getQuery(); for (Parameter parameter : form) { System.out.println(* + parameter.getName() += + parameter.getValue()); Best regards, Jerome Louvel -- Restlet ~ Founder and Lead developer ~ http://www.restlet.org Noelios Technologies ~ Co-founder ~ http://www.noelios.com -Message d'origine- De : news [mailto:n...@ger.gmane.org] De la part de Leshek Envoye : jeudi 11 decembre 2008 01:01 A : discuss@restlet.tigris.org Objet : Re: Restlet way to parse uri Qyery component - invoke the getQueryAsForm method on the resource's reference KLOCs kill and this is as short and clear as it gets (me thinks). Form form = this.getRequest().getResourceRef().getQueryAsForm(); for (Parameter parameter : form) { System.out.println(* + parameter.getName() += + parameter.getValue()); . . . Thank you Thierry, very much for elegant answer delivered with lighting speed! -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=982612 -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=990924
Re: REQUEST FireFox cache control
Welcome back, Jerome! That timeframe works for me. On Tue, Dec 23, 2008 at 3:21 PM, Jerome Louvel jerome.lou...@noelios.comwrote: Caching support is definitely something high on Restlet 1.2 priority list, but I'm not too keen on changing the API in an incremental Restlet 1.1 release. I , will however make sure that Restlet 1.2 is released in time, adjusting the features scope if necessary. I'm hoping for a 1.2 M1 in January. -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=990933
Metadata service
Dear all, maybe this is a trivial question but I cannot get the MetadataService to work as I expect. I started from the HelloWorld example in http://www.restlet.org/documentation/1.1/firstSteps I added a new Variant to the HelloWorldResource (APPLICATION_ATOM_XML) and attached it to the /hello route. When I GET /hello.atom the variant requested is always TEXT/PLAIN and not, APPLICATION_ATOM_XML. I tried different things in FirstStepsApplication.createRoot() method: - getMetadataService().addCommonExtensions() - getMetadataService().setEnabled(true) - getMetadataService().start() But I always get the same behavior (i.e., the .atom extension does not trigger a request for the ATOM variant) What is the correct way to setup this behavior? Thanks, Fabio -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=990945
Re: Metadata service
I'm not sure if this is the complete answer, but is your tunnel service enabled, and set to tunnel extensions? You can do something like (from an Application): getTunnelService().setEnabled(true); getTunnelService().setExtensionsTunnel(true); On Tue, Dec 23, 2008 at 4:04 PM, fabio.mancine...@gmail.com wrote: Dear all, maybe this is a trivial question but I cannot get the MetadataService to work as I expect. I started from the HelloWorld example in http://www.restlet.org/documentation/1.1/firstSteps I added a new Variant to the HelloWorldResource (APPLICATION_ATOM_XML) and attached it to the /hello route. When I GET /hello.atom the variant requested is always TEXT/PLAIN and not, APPLICATION_ATOM_XML. I tried different things in FirstStepsApplication.createRoot() method: - getMetadataService().addCommonExtensions() - getMetadataService().setEnabled(true) - getMetadataService().start() But I always get the same behavior (i.e., the .atom extension does not trigger a request for the ATOM variant) What is the correct way to setup this behavior? Thanks, Fabio -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=990945 -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=990972
RE: ApplicationStatusFilter - bug ???
Hi guys, Very reasonable indeed. I've fixed the behavior in SVN branch 1.1 and in SVN trunk (with additional refactoring in the engine). Best regards, Jérôme Louvel -- Restlet ~ Founder and Lead developer ~ http://www.restlet.org Noelios Technologies ~ Co-founder ~ http://www.noelios.com -Message d'origine- De : Thierry Boileau [mailto:thierry.boil...@noelios.com] Envoyé : jeudi 11 décembre 2008 17:30 À : discuss@restlet.tigris.org Objet : Re: ApplicationStatusFilter - bug ??? Hello Rémi, your suggestion looks really reasonnable. As I'm not fully aware of the original design choice, I've entered an RFC = http://restlet.tigris.org/issues/show_bug.cgi?id=683 Best regards, Thierry Boileau -- Restlet ~ Core developer ~ http://www.restlet.org Noelios Technologies ~ Co-founder ~ http://www.noelios.com Hello, I just wonder if it is a bug having in ApplicationStatusFilter : public ApplicationStatusFilter(Application application) { super(application.getContext(), application.getStatusService() .isOverwrite(), application.getStatusService() .getContactEmail(), /); } instead of something like that : public ApplicationStatusFilter(Application application) { super(application.getContext(), application.getStatusService() .isOverwrite(), application.getStatusService() .getContactEmail(), application.getStatusService().getHomeRef().getTargetRef().toString()); } Because that way doing this on Application initialization has no effect: getStatusService().setHomeRef(new Reference(/some/path/)); Cheers, Rémi -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=982916 -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=990973