Routing woes...

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Routing woes...

Niclas Hedhman

Hi, (not sure if this is still the proper mailing list)

I have in a new project the need to let a Finder provide the ServerResource subclass for ALL URI paths, instead of individual matching.

I want to do something like;

        Finder finder = createRestletFinder( EntityListServerResource.class, getContext() );
        router.attach( "/*", finder );
        return router;

But I can't figure out what I really need to write as the pathTemplate, RFC6570 isn't the easiest document to understand coming from the cold.

I also tried to set the RequiredScore to a very negative number, but that didn't help.


Thanks
--
Niclas Hedhman, Software Developer
河南南路555弄15号1901室。
http://www.qi4j.org - New Energy for Java

I live here; http://tinyurl.com/3xugrbk
I work here; http://tinyurl.com/6a2pl4j
I relax here; http://tinyurl.com/2cgsug
Reply | Threaded
Open this post in threaded view
|

Re: Routing woes...

Arjohn Kampman-2
Perhaps attachDefault(...) does what you're looking for? Or maybe you
don't need the router at all and attach the Finder to whatever you are
attaching the Router to?


On 08/12/2013 16:46, Niclas Hedhman wrote:

>
> Hi, (not sure if this is still the proper mailing list)
>
> I have in a new project the need to let a Finder provide the
> ServerResource subclass for ALL URI paths, instead of individual matching.
>
> I want to do something like;
>
>         Finder finder = createRestletFinder(
> EntityListServerResource.class, getContext() );
>         router.attach( "/*", finder );
>         return router;
>

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=3069980
Reply | Threaded
Open this post in threaded view
|

Re: Routing woes...

Thierry Boileau-4
Hello,

perhaps you don't need the ServerResource class, and can directly define your own Restlet subclass:

            @Override
            public Restlet createInboundRoot() {
                Restlet restlet = new Restlet(getContext()) {
                    @Override
                    public void handle(Request request, Response response) {
                        // TODO Auto-generated method stub
                        super.handle(request, response);
                    }
                };
                return restlet;
            }

Best regards,
Thierry Boileau



2013/12/9 Arjohn Kampman <[hidden email]>
Perhaps attachDefault(...) does what you're looking for? Or maybe you
don't need the router at all and attach the Finder to whatever you are
attaching the Router to?


On 08/12/2013 16:46, Niclas Hedhman wrote:
>
> Hi, (not sure if this is still the proper mailing list)
>
> I have in a new project the need to let a Finder provide the
> ServerResource subclass for ALL URI paths, instead of individual matching.
>
> I want to do something like;
>
>         Finder finder = createRestletFinder(
> EntityListServerResource.class, getContext() );
>         router.attach( "/*", finder );
>         return router;
>

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