Hi Mohamed,

you have to attach the Router to the Guard, not the resource classses.

best regards
   Stephan

Mohamed Abdel-Aziz Bayoumi schrieb:
> Hi,
>
> Is there a way i can use to get the same guard object protecting multiple
> resources ? i tried using this but without hope
>
>  @Override
>     public synchronized Restlet createRoot() {
>
>         Router router = new Router(getContext());
>         Guard testGuard = new Guard(getContext(),
> ChallengeScheme.HTTP_BASIC, "Adding Access Control");        
>
>         testGuard.getSecrets().put("uname","passwd".toCharArray());
>         testGuard.setNext(FileUploader.class);
>         testGuard.setNext(FileDownloader.class);
>         testGuard.setNext(MainPage.class);
>         
>         // Defines routes
>         router.attach("/myapp/main", testGuard);   
>         router.attach("/obama/uploadfile", testGuard);
>         router.attach("/obama/getfile", testGuard);
>         return router;
>     }
>
> that didn't work of course, i need to know how to do it (may be via a realm,
> but i don't know how to define realms)
>
> Thanks
>

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=994300

Reply via email to