Mail sent on the 08/22 and apparently lost. --- Hello,
I'm afraid the Template class does not allow you to set the variables as you need. I think it is simpler to define yor own templae class based on a reg exp anduse it when you define the routes:
router.getRoutes().add(
new Route(router,
new MyTemplate(regexp),
restlet));
I send you a sample template class based on regexp pattern and a
server/client test code.
Hi Prashant, Just have a look at the Javadocs, there is a "match(String)" method that you can use. You might need to adjust the matching mode and the default variable to fit your matching needs. Best regards, Jerome Louvel -- Restlet ~ Founder and Lead developer ~ http://www.restlet.org Noelios Technologies ~ Co-founder ~ http://www.noelios.comI'm looking for a way to match a URI in the form of /file/[a-z]{3}-[0-9]{5}.[a-z]+ i would want to put the first part (before the dot) in one variable and the second part (after the dot) in another. Can somebody point me to an example or tutorial or something to do just that if its possible to do it? I tried the form: /file/{item}.{ext} but this doesn't work it looks like the dot is not used that way in the URI template schema. Also the javadocs doesnt explain how to use the Template match function or what do adjust. Thanks.
-- Best regards, Thierry Boileau -- Restlet ~ Core developer ~ http://www.restlet.org <http://www.restlet.org/>Noelios Technologies ~ Co-founder ~ http://www.noelios.com <http://www.noelios.com/>
testTemplateCustomized.jar
Description: application/java-archive

