Yeah the problem IMHO is that you're returning the guard, and the guard knows
nothing about your URL scheme if I'm not mistaken. This needs something like
router - guard - resource
instead of
guard - router - resource.
alternatively, there should be an easy way to pattern match a guard to
Thanks again for the update - I will continue to work on this, although right
now I am in the midst of trying to get oAuth2 to work, so it may be a while
before I have a real response.
RB
--
View this message in context:
Hello Richard,
I suggest you to update your code as follow:
public final Restlet createInboundRoot() {
Router rootRouter = new Router(getContext());
Router guardedRouter = new Router(getContext());
// attach your resources, relatively to the root path /v1
guardedRouter.attach(/test,
Thanks - that works perfectly for me.
I had been returning the guard to fix an earlier problem - but obviously I
fixed it in the wrong way.
Thanks again for the detailed solution!
RB
--
View this message in context:
I haven't tested this so please accept my apologies if it doesn't work. You
could use the following form of attach()
public Route attach(String pathTemplate,
Class? targetClass,
int matchingMode)
and attach your guard with a Template.MODE_STARTS_WITH
Thank you for the response...
My simplified test code is now:
public final Restlet createInboundRoot() {
Router router = new Router(getContext());
router.attach(/v1/, RootServerResource.class);
router.attach(/v2/, RootServerResource.class);
GaeAuthenticator guard = new
6 matches
Mail list logo