Hi Serge,

For the referrer, there is the Request.getReferrerRef().

For the routing, this URI that matches the most number of characters wins in
the default routing mode (BEST_MATCH). For the directory, you can try
attachDefault(directory) instead of the "" URI. You can also play with the
routing modes and the order of the attachments (using the FIRST routing mode
for example).

Best regards,
Jerome  

> -----Message d'origine-----
> De : news [mailto:[EMAIL PROTECTED] De la part de serge
> Envoyé : dimanche 5 août 2007 01:34
> À : discuss@restlet.tigris.org
> Objet : two quick questions
> 
> 1. I was looking for a way to set routing  to serve a dynamic 
> content (home
> page) from the root (nothing is specified) and static files 
> from the root if
> file name is specified. I found that this is working:
> 
>     Directory directory = new Directory(getContext(),
> Constants.STATIC_FILE_LOCATION);
>     router.attach("/files", directory);
>     router.attach("", directory);
>     router.attach("/", HomeResource.class);
> 
> I am wondering if the last two lines are a hack, or indeed 
> that's how it's
> intended. I am also wondering how do you solve this "dilemma" 
> on your site -
> obviously you did it since http://www.restlet.org/favicon.ico 
> works correctly
> and http://www.restlet.org resolves as well.
> 
> 2. Another question - is there an easy way to get 
> HTTP_Referer value for a
> regular HTTP request? I am looking for an API similar to
> request.getClientInfo().getAgent() for user agent.
> 
> Thanks,
> 
> Serge

Reply via email to