Skip to content

We should be able to add / and /* to RouterService  #52

Description

@sbernard31

Currently this is not possible to do :

RouterService.RouteBuilder routerBuilder = new RouterService.RouteBuilder();
routerBuilder //
        .any("/", new RootResource() //
        .any("/myResource", new MyResource() //
        .any("/*", new Default());
router = routerBuilder.build();

If you do that RootResource will never be called.
I think this is because / and /* will create 2 RequestMatcher which will be considered as equal and so Default will override RootResource in handlers hashmap.
Maybe the solution is to add isPrefixed attribute to equals() and hashcode() methods ?

(triggered by #27 (comment))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions