I have a vague idea about somehow comparing the routing-template that lead to this resource with the actual Resourc-Reference... but I can't find a way to get the template that routed to this resource (I have multiple templates that sometimes route to the same resource)

so what I need is something like resource.getRequest.getTemplate
or Application.getCurrent.getRouter.getTemplate(thisResource)

Ralf Bommersbach schrieb:
Hi there.
Suppose I have an URL that itself has an URL embedded, like .../service/{service_url}/resource1/resource2/.../...

If I call request.getResourceRef.getSegments(), I get a list of all the Segments of the URL, BUT because the method only looks for slashes it also tokenizes the pieces of the embedded url. What if I want the embedded URL as ONE Segment. Is there a built-in way in Restlet to do this? (hint: I have already declared the template param service_url as Variable.TYPE_URI_PATH.

Best regards
Ralf

Reply via email to