Skip to content

Expose Configuration for ControllerLinkBuilder #400

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
SingleShot opened this issue Oct 15, 2015 · 0 comments
Open

Expose Configuration for ControllerLinkBuilder #400

SingleShot opened this issue Oct 15, 2015 · 0 comments

Comments

@SingleShot
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant