Skip to content

Expose Configuration for ControllerLinkBuilder #400

Open
@SingleShot

Description

@SingleShot

ControllerLinkBuilder uses some configurable components but they are not exposed for clients. For example, if one is using a domain object in a controller method and wants to generate a URI from the method, they cannot do so. For example:

BookSearch search = new BookSearch("author:johnson genre:technical");
Link link = linkTo(methodOn(BookController.class).fetchBooks(search)).withSelfRel();

The above, without the ability to get into the internal factory of ControllerLinkBuilder and configure a custom UriComponentsContributor, the resulting URI would look like this:

/books

When it is expected to look like this:

/books?search=author:johnson%20genre:technical

I've tried a bunch of techniques to solve this and so far the only solution is very bad: create a bean that will use reflection to get access to the internal factory and register UirComponentsContributors during startup.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions