On Sun, Apr 28, 2013 at 12:58 PM, Grant <[email protected]> wrote:
> I am attaching my DynRedirector at:
> http://foo:port/a
>
What's the code for this? It could be a Component level routing:
VirtualHost host = component.getDefaultHost();
host.attach("/a", new DynRedirector(... args ...));
or an Application level routing:
host.attach("/a", new MyApplication());
...
// In MyApplication.createInboundRoot:
router.attachDefault(new DynRedirector(... args ...));
If it doesn't fall into one of these two camps, it's a good bet that your
problem lies there.
> I am, at run time, making a call to http://foo:port/a/b. Thus, "/b" is
> my "child" endpoint and "/a" is my parent endpoint (ie the one that _is_
> the Redirector). Not sure if this is the right nomenclature for Restlet,
> so please correct me.
>
I would have said that you want all requests for resources at URIs with a
prefix of http://foo:port/a to be handled by an instance of DynRedirector.
I can see that the Restlet that owns the DynRedirector is getting selected,
> but then it is not able to find it's next route b/c "/b" was never
> officially attached since it is (in my mind) supposed to be handled by the
> {rr} part. I suspect my issue is in how I am handling the {rr} part when I
> am attaching the DynamicRedirector to the owning Restlet.
>
Again, if DynRedirector.getTargetRef isn't being called at all, then the
template argument passed to DynRedirector isn't being used, so "handled by
the {rr} part" doesn't mean anything.
I think you're confusing the path provided to attach, which can be a
template pattern, with the template pattern passed to the Redirector. The
former is used during routing, the latter is made available to getTargetRef
to be used in determining a target reference from values in the current
request and response.
--tim
------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=3054497