RE: URI Pattern matching based on regular expressions
Let me also qualify this by describing what i'm attempting to do. Each URL in my app has misc attributes associated with it. I.e. function seq, name, weighting, validating reg exp pattern, etc I'm currently using this to authenticate users to resources. However, there is some overlap between the pattern i use to match the function versus what restlet currently provides. As an alternative, if i could create a custom 'Route' object and populate these extra attribs on the object, then get hold of the route on the Request, i can solve the problem that way as well. Can one get hold of the current 'route' during normal processing? i.e. on the request? How would i go about doing the above? -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2440016
Stack Overflow Error in firstSteps 2.0 m6 code?
Hello, So I tried firing up the firstSteps standalone app with RESTlet 2.0 m6 and I got a stackoverflowerror upon running it. Any ideas as to what may be up? I copied the code exactly from the website... I'm a bit of a java noob though so that may be part of it. Thanks, Andrew Here is my stacktrace: Exception in thread "main" java.lang.StackOverflowError at java.lang.String.indexOf(Unknown Source) at java.net.URLStreamHandler.parseURL(Unknown Source) at sun.net.www.protocol.file.Handler.parseURL(Unknown Source) at java.net.URL.(Unknown Source) at java.net.URL.(Unknown Source) at sun.misc.URLClassPath$FileLoader.getResource(Unknown Source) at sun.misc.URLClassPath$FileLoader.findResource(Unknown Source) at sun.misc.URLClassPath$1.next(Unknown Source) at sun.misc.URLClassPath$1.hasMoreElements(Unknown Source) at java.net.URLClassLoader$3$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader$3.next(Unknown Source) at java.net.URLClassLoader$3.hasMoreElements(Unknown Source) at sun.misc.CompoundEnumeration.next(Unknown Source) at sun.misc.CompoundEnumeration.hasMoreElements(Unknown Source) at sun.misc.CompoundEnumeration.next(Unknown Source) at sun.misc.CompoundEnumeration.hasMoreElements(Unknown Source) at org.restlet.engine.util.EngineClassLoader.getResources(EngineClassLoader.java:157) at org.restlet.engine.Engine.registerHelpers(Engine.java:724) at org.restlet.engine.Engine.discoverConnectors(Engine.java:475) at org.restlet.engine.Engine.(Engine.java:325) at org.restlet.engine.Engine.register(Engine.java:246) at org.restlet.engine.Engine.register(Engine.java:235) at org.restlet.engine.Engine.getInstance(Engine.java:148) at org.restlet.engine.Engine.getLogger(Engine.java:203) at org.restlet.Context.getCurrentLogger(Context.java:87) at org.restlet.engine.Engine.registerHelper(Engine.java:659) at org.restlet.engine.Engine.registerHelpers(Engine.java:688) at org.restlet.engine.Engine.registerHelpers(Engine.java:730) at org.restlet.engine.Engine.discoverConnectors(Engine.java:475) at org.restlet.engine.Engine.(Engine.java:325) at org.restlet.engine.Engine.register(Engine.java:246) at org.restlet.engine.Engine.register(Engine.java:235) at org.restlet.engine.Engine.getInstance(Engine.java:148) at org.restlet.engine.Engine.getLogger(Engine.java:203) at org.restlet.Context.getCurrentLogger(Context.java:87) at org.restlet.engine.Engine.registerHelper(Engine.java:659) at org.restlet.engine.Engine.registerHelpers(Engine.java:688) at org.restlet.engine.Engine.registerHelpers(Engine.java:730) at org.restlet.engine.Engine.discoverConnectors(Engine.java:475) at org.restlet.engine.Engine.(Engine.java:325) at org.restlet.engine.Engine.register(Engine.java:246) at org.restlet.engine.Engine.register(Engine.java:235) at org.restlet.engine.Engine.getInstance(Engine.java:148) at org.restlet.engine.Engine.getLogger(Engine.java:203) at org.restlet.Context.getCurrentLogger(Context.java:87) at org.restlet.engine.Engine.registerHelper(Engine.java:659) at org.restlet.engine.Engine.registerHelpers(Engine.java:688) at org.restlet.engine.Engine.registerHelpers(Engine.java:730) at org.restlet.engine.Engine.discoverConnectors(Engine.java:475) at org.restlet.engine.Engine.(Engine.java:325) -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2440121
Re: Restlet client and setting the request header date
Hello Garry, I'm sorry for the delay of my answer. At this moment, we need some to support the EXPECT header (see http://restlet.tigris.org/issues/show_bug.cgi?id=413) which is planned for the 2.0 RC. Some pieces are needed in order to make the Request#onResponse() able to catch such intermediary responses. Regarding the support S3 scheme, the client side of this scheme is available and is working (via the "crypto" extension). I see that it is based on the Date header (or the current Date). I've fixed the report issue regarding the DATE header. Thus, you will be able to set your own date. Best regards, Thierry Boileau > 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 > Expect/CONTINUE -- but it looks like I'll not be able to build a > Restlet-based client. > > Which makes me ask what the point is of the support for the S3 scheme in > ChallengeResponse? The values in that scheme are dependent on being able > to read and sign actual header values such as Date. > > I read the Javadoc for onContinue and when it said it was called before > the entity was sent I wasn't sure just how literal that was. Not sure > about that use case but for my purposes a callback prior to the dispatch > of the entire request that would allow examination and modification of the > actual request (both headers and entity) to be sent would be really > useful. > > Cheers, > Garry > > > On Thu, 14 Jan 2010, Thierry Boileau wrote: > > >> 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, >> Thierry Boileau >> >> >>> Hi, >>> >>> I too hit this problem as I wanted to set a specific value for the Date >>> header. >>> >>> In absence of this ability -- I've seen issue 1001 -- can I get the value >>> of the header client side before the request is sent in any way? I want to >>> set another header based on the date. >>> >>> I thought that setting a Uniform instance as the oncontinue handler of the >>> ClientResource would allow this but the handle() method in Uniform doesn't >>> seem to be called before the request is actually sent? >>> >>> Thanks, >>> Garry >>> >>> -- >>> http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2436971 >>> >>> >>> >> -- >> http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2437281 >> > -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2440023
URI Pattern matching based on regular expressions
Hi Guys, Given a map of regular expression patterns and their associated resources what is the easiest way i can go about adding some sort of custom uri matching. Does anyone have some sort of example? I've seen the wiki link - http://wiki.restlet.org/docs_2.0/13-restlet/27-restlet/143-restlet.html - and the attached example... but i'm still unclear on how i'm supposed to plug in this functionality. Could someone give me some guidance on this? Thank you, --KD -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2440008
Re: Basic HTTP Auth without Guards?
It works now :-) I've edited my web.xml file to use this: rest com.noelios.restlet.ext.spring.RestletFrameworkServlet targetRestletBeanName guard 1 Instead of this: rest com.noelios.restlet.ext.spring.RestletFrameworkServlet Thanks again :-) mkhatib wrote: > > Sorry I meant to say Can I attach the Guard to the Router Directly in the > xml file? > > > mkhatib wrote: >> >> Hey, >> Thanks Sutphin! Now it works when I run it as a standalone application, >> SpringComponent component = (SpringComponent) >> context.getBean("restletComponent"); >> component.start() >> >> However when I run it on Tomcat, it still doesn't do much, Is there >> specific configurations to use this Guard with Tomcat? >> >> I've in My Web.xml: >> >> >> rest >> >> com.noelios.restlet.ext.spring.RestletFrameworkServlet >> >> >> >> >> rest >> /* >> >> >> >> >> org.springframework.web.context.ContextLoaderListener >> >> >> And my rest-servlet.xml is like what I post earlier, >> My guess is that tomcat ignores the application and guard beans in the >> rest-servlet.xml and uses the router directly. Can I attach the router >> directly in the xml file? >> >> Thanks again >> >> >> >> >> Rhett Sutphin wrote: >>> >>> Hi, >>> >>> On Jan 18, 2010, at 6:09 AM, mkhatib wrote: >>> I am trying to implement web services that will be used on an iPhone client. I need the user to authenticate and then make sure he is authorized before executing an action. I am using Spring 2.5.6 along with Restlet 1.1.7. >>> >>> What is the root property for the "app" bean? It should be the guard. >>> >>> Rhett >>> >>> class="org.restlet.ext.spring.SpringComponent"> >>> class="ps.exalt.iywave.server.api.security.CustomAuth" scope="singleton"/> >>> class="ps.exalt.iywave.server.api.security.CustomGaurd" scope="singleton"> The problem is it is not asking for authentication, is there anything I am missing? >>> >>> -- >>> http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2439985 >>> >>> >> >> > > -- View this message in context: http://n2.nabble.com/Basic-HTTP-Auth-without-Guards-tp4413298p4413770.html Sent from the Restlet Discuss mailing list archive at Nabble.com. -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=243
Re: Basic HTTP Auth without Guards?
Sorry I meant to say Can I attach the Guard to the Router Directly in the xml file? mkhatib wrote: > > Hey, > Thanks Sutphin! Now it works when I run it as a standalone application, > SpringComponent component = (SpringComponent) > context.getBean("restletComponent"); > component.start() > > However when I run it on Tomcat, it still doesn't do much, Is there > specific configurations to use this Guard with Tomcat? > > I've in My Web.xml: > > > rest > > com.noelios.restlet.ext.spring.RestletFrameworkServlet > > > > > rest > /* > > > > > org.springframework.web.context.ContextLoaderListener > > > And my rest-servlet.xml is like what I post earlier, > My guess is that tomcat ignores the application and guard beans in the > rest-servlet.xml and uses the router directly. Can I attach the router > directly in the xml file? > > Thanks again > > > > > Rhett Sutphin wrote: >> >> Hi, >> >> On Jan 18, 2010, at 6:09 AM, mkhatib wrote: >> >>> I am trying to implement web services that will be used on an iPhone >>> client. >>> I need the user to authenticate and then make sure he is authorized >>> before >>> executing an action. I am using Spring 2.5.6 along with Restlet 1.1.7. >>> >>> >>> >>> >> >> What is the root property for the "app" bean? It should be the guard. >> >> Rhett >> >>> >>> >>> >>> >> class="org.restlet.ext.spring.SpringComponent"> >>> >>> >> class="ps.exalt.iywave.server.api.security.CustomAuth" >>> scope="singleton"/> >>> >>> >> class="ps.exalt.iywave.server.api.security.CustomGaurd" >>> scope="singleton"> >>> >>> >>> >>> >>> >>> The problem is it is not asking for authentication, is there anything I >>> am >>> missing? >> >> -- >> http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2439985 >> >> > > -- View this message in context: http://n2.nabble.com/Basic-HTTP-Auth-without-Guards-tp4413298p4413710.html Sent from the Restlet Discuss mailing list archive at Nabble.com. -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2439996
Re: Basic HTTP Auth without Guards?
Hey, Thanks Sutphin! Now it works when I run it as a standalone application, SpringComponent component = (SpringComponent) context.getBean("restletComponent"); component.start() However when I run it on Tomcat, it still doesn't do much, Is there specific configurations to use this Guard with Tomcat? I've in My Web.xml: rest com.noelios.restlet.ext.spring.RestletFrameworkServlet rest /* org.springframework.web.context.ContextLoaderListener And my rest-servlet.xml is like what I post earlier, My guess is that tomcat ignores the application and guard beans in the rest-servlet.xml and uses the router directly. Can I attach the router directly in the xml file? Thanks again Rhett Sutphin wrote: > > Hi, > > On Jan 18, 2010, at 6:09 AM, mkhatib wrote: > >> I am trying to implement web services that will be used on an iPhone >> client. >> I need the user to authenticate and then make sure he is authorized >> before >> executing an action. I am using Spring 2.5.6 along with Restlet 1.1.7. >> >> >> >> > > What is the root property for the "app" bean? It should be the guard. > > Rhett > >> >> >> >> > class="org.restlet.ext.spring.SpringComponent"> >> >> > class="ps.exalt.iywave.server.api.security.CustomAuth" >> scope="singleton"/> >> >> > class="ps.exalt.iywave.server.api.security.CustomGaurd" >> scope="singleton"> >> >> >> >> >> >> The problem is it is not asking for authentication, is there anything I >> am >> missing? > > -- > http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2439985 > > -- View this message in context: http://n2.nabble.com/Basic-HTTP-Auth-without-Guards-tp4413298p4413669.html Sent from the Restlet Discuss mailing list archive at Nabble.com. -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2439993
Re: Basic HTTP Auth without Guards?
Hi, On Jan 18, 2010, at 6:09 AM, mkhatib wrote: > I am trying to implement web services that will be used on an iPhone client. > I need the user to authenticate and then make sure he is authorized before > executing an action. I am using Spring 2.5.6 along with Restlet 1.1.7. > > > > What is the root property for the "app" bean? It should be the guard. Rhett > > > > > > class="ps.exalt.iywave.server.api.security.CustomAuth" scope="singleton"/> > > scope="singleton"> > > > > > > The problem is it is not asking for authentication, is there anything I am > missing? -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2439985
Basic HTTP Auth without Guards?
I am trying to implement web services that will be used on an iPhone client. I need the user to authenticate and then make sure he is authorized before executing an action. I am using Spring 2.5.6 along with Restlet 1.1.7. The problem is it is not asking for authentication, is there anything I am missing? -- View this message in context: http://n2.nabble.com/Basic-HTTP-Auth-without-Guards-tp4413298p4413298.html Sent from the Restlet Discuss mailing list archive at Nabble.com. -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2439979
RE: Re: Restlet and GWT 2.0
Hello, Has anyone an idea of what is going wrong? I would like to use restlet as it seems to be a promising framework but I still cannot get it working. Regards, Christophe. -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2439962