Re: Getting 403 Forbidden rather than 401 Unauthorized when using HTTP Basic auth
Hi Ian, in Restlet 1.1 this behaviour was changed. Perhaps Jerome or Thierry also included the change in 1.0.x. Check, if there is a setter Guard.setRechallengeEnabled(boolean)? Otherwise change to Restlet 1.1. best regards Stephan Ian Clarke schrieb: I followed the code in this tutorial: http://www.restlet.org/documentation/1.0/tutorial#part09 But when the authentication fails, I'm getting a 403 error, rather than a 401 error as the code suggests. This is with Restlet v1.0.11 - any ideas? Regards, Ian.
Typo in org.restlet.resource.Resource#allowPut javadoc
The javadoc for allowPut says Indicates if DELETE calls are allowed...: http://restlet.tigris.org/source/browse/restlet/trunk/modules/org.restlet/src/org/restlet/resource/Resource.java?view=markup --Erik
RE: uriPattern exactness
Hi John, We have an RFE to improve our support for URI Template. I've added a comment in it to attempt to cover your use case better: Update the URI template support http://restlet.tigris.org/issues/show_bug.cgi?id=476 This would result in this pattern: /foos/{foo}/bar{-prefix|.|ext} 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 : John D. Mitchell [mailto:[EMAIL PROTECTED] Envoye : vendredi 17 octobre 2008 16:54 A : discuss@restlet.tigris.org Objet : Re: uriPattern exactness On Friday 2008.10.17, at 04:01 , Jerome Louvel wrote: [...] In combination with MODE_EQUALS, you could also add a variable for your extensions like: /foos/{foo}/bar.{ext}. That could reduce the number of alternative routes you would have to attach. Yes and no. I use that trick but I still have to also have e.g.: /foos/{foo}/bar as well since the dot shouldn't be there if there's no extension. When I last looked, I couldn't find any way to make things optional (so if it's still not possible to do that in the latest versions, I'd suggest looking into it -- something like /bar(.{ext})? so that it hangs together properly). FWIW, I do send both to the same resource and just have the resource look for the optional parts. e.g.: ext = (String) request.getAttributes().get(ext); if (null == ext) ext = ; I've also used a combination of EQUALS and the default STARTS_WITH to keep the numbers of routes a bit more manageable. Take care, John
EJB 3
Hi, I'm evaluating my current stack and am interested using EJB3. Naturally, I still want to use restlet :). If anyone is doing this, I'd be grateful if you shared your setup and any issues you've run across. thanks, Jon
Re: Spring configuration example using com.noelios.restlet.ext.spring package
Thank you. Mark On Oct 17, 2008, at 8:54 AM, Rhett Sutphin wrote: Hi Mark, You might also consider using SpringBeanRouter. If you only have one URI mapping per resource, it allows your URIs to be mapped directly in the bean definitions. Your example would be like this using SpringBeanRouter (note: not tested): !-- server bean as before -- bean name=router class=org.restlet.ext.spring.SpringBeanRouter/ bean name=/account/register id=registerResource class=com.mspetrovic.server.restlet.RegisterResource scope=prototype/ bean name=/account/login id=loginResource class=com.mspetrovic.server.restlet.LoginResource scope=prototype/ bean name=/account/confirm/{confirmationKey} id=confirmationResource class=com.mspetrovic.server.restlet.AccountConfirmationResource scope=prototype/ bean name=/callsign/bind id=bindCallsignResource class=com.mspetrovic.server.restlet.BindCallsignResource scope=prototype/ bean name=/license/lookup/{callsign} id=lookupLicenseResource class=com.mspetrovic.server.restlet.LookupCallsignResource scope=prototype/ bean name=/log/{logname} id=createLogResource class=com.mspetrovic.server.restlet.LogResource scope=prototype/ bean name=/log/export/{logname} id=exportLogResource class=com.mspetrovic.server.restlet.LogExportResource scope=prototype/ bean name=/qso/{logname}/{range} id=qsoResource class=com.mspetrovic.server.restlet.QSOResource scope=prototype/ Rhett On Oct 17, 2008, at 9:10 AM, Mark Petrovic wrote: I'm posting my take on the Spring config detailed on the wiki. Previously I had been using a subclass of Application, with multiple invocations of router.attach() (per the FirstResource app) to get routing done to specific restlets. Hope this helps someone out there get over the hump. In your main() method, get the bean server and do a server.start() on it as one would normally do with a Component: bean id=server class=org.restlet.ext.spring.SpringComponent property name=server bean class=org.restlet.ext.spring.SpringServer constructor-arg value=HTTP / constructor-arg value=8182 / /bean /property property name=defaultTarget ref=router / /bean bean id=router class=org.restlet.ext.spring.SpringRouter property name=attachments map entry key=/account/register bean class=org.restlet.ext.spring.SpringFinder lookup-method name=createResource bean=registerResource / /bean /entry entry key=/account/login bean class=org.restlet.ext.spring.SpringFinder lookup-method name=createResource bean=loginResource / /bean /entry entry key=/account/confirm/{confirmationKey} bean class=org.restlet.ext.spring.SpringFinder lookup-method name=createResource bean=confirmationResource / /bean /entry entry key=/callsign/bind bean class=org.restlet.ext.spring.SpringFinder lookup-method name=createResource bean=bindCallsignResource / /bean /entry entry key=/license/lookup/{callsign} bean class=org.restlet.ext.spring.SpringFinder lookup-method name=createResource bean=lookupLicenseResource / /bean /entry entry key=/log/{logname} bean class=org.restlet.ext.spring.SpringFinder lookup-method name=createResource bean=createLogResource / /bean /entry entry key=/log/export/{logname} bean class=org.restlet.ext.spring.SpringFinder lookup-method name=createResource bean=exportLogResource / /bean /entry entry key=/qso/{logname} bean class=org.restlet.ext.spring.SpringFinder lookup-method name=createResource bean=qsoResource / /bean /entry entry key=/qso/{logname}/{range} bean class=org.restlet.ext.spring.SpringFinder lookup-method name=createResource bean=qsoResource / /bean /entry /map /property /bean bean id=registerResource class=com.mspetrovic.server.restlet.RegisterResource scope=prototype/ bean id=loginResource class=com.mspetrovic.server.restlet.LoginResource scope=prototype/ bean id=confirmationResource class=com.mspetrovic.server.restlet.AccountConfirmationResource scope=prototype/ bean id=bindCallsignResource class=com.mspetrovic.server.restlet.BindCallsignResource scope=prototype/ bean id=lookupLicenseResource
Re: Restlet-GWT HTTP authentication example
Thank you. Mark On Oct 17, 2008, at 11:26 AM, Thierry Boileau wrote: Hello Mark, I've updated the sample application and its description: http://wiki.restlet.org/docs_1.1/13-restlet/28-restlet/144- restlet.html Best regards, Thierry Boileau -- Restlet ~ Core developer ~ http://www.restlet.org Noelios Technologies ~ Co-founder ~ http://www.noelios.com Thierry, good day. Is there sample code available showing how to use the HTTP Digest authentication scheme? Hello Mark, the current sample GWT application has been updated with authentication, and usage of JSON and XML representations. See http://wiki.restlet.org/docs_1.1/13-restlet/28-restlet/144-restlet.html . Best regards, Thierry Boileau -- Restlet ~ Core developer ~ http://www.restlet.org Noelios Technologies ~ Co-founder ~ http://www.noelios.com Does anyone have a couple of code snippets, with qualifying and explanatory comments, they can share that demonstrate both the client and server side of the new Restlet-GWT HTTP authentication? I just might be getting the hang of Restlet programming, and authentication and login-state without that warm, cozy servlet session state is the last piece I need to envision my app end to end. Thanks. Mark