We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
When I reverse a method by specifying a get parameter with an URL, the URL is not escaped correctly. For example, if I do:
resource.add(linkTo(methodOn(controllerClass).getCommentOfArticle(resource.getBaseUrl()+"&toto=2")).withRel("commentsOnSameNews"));
Where getCommentOfArticle is the following method inside a @RestController:
@RequestMapping(method = RequestMethod.GET) public List<CommentResource> getCommentOfArticle( @RequestParam("baseUrl") String baseUrl) { return commentResourceAssembler.toResources(commentService .getComments(baseUrl, pageUrl)); }
It will generate the following link:
http://localhost:8080/myproject/resources/comment?baseUrl=http://localhost:8080/cmstoolsWeb&toto=2
Instead of
http://localhost:8080/myproject/resources/comment?baseUrl=http%3A%2F%2Flocalhost%3A8080%2Ftest.jsp%26toto%3D2
This is verry anoying because if I escape it before, then Spring hateaos reescape my %. So I have to this and it's really horrible :
String linkWithPageHolder = linkTo( methodOn(controllerClass).getCommentOfArticle( "baseUrlPlaceHolder",)).withRel( "useless").getHref(); linkWithPageHolder = linkWithPageHolder.replaceFirst( "baseUrlPlaceHolder", EncodingUtil.encodeURIComponent(resource.getBaseUrl())); String linkWithPageHolder = linkTo( methodOn(controllerClass).getCommentOfArticle( "baseUrlPlaceHolder", "pageUrlPlaceHolder")).withRel( "useless").getHref(); linkWithPageHolder = linkWithPageHolder.replaceFirst( "baseUrlPlaceHolder", EncodingUtil.encodeURIComponent(resource.getBaseUrl()));
The text was updated successfully, but these errors were encountered:
No branches or pull requests
When I reverse a method by specifying a get parameter with an URL, the URL is not escaped correctly.
For example, if I do:
Where getCommentOfArticle is the following method inside a @RestController:
It will generate the following link:
Instead of
This is verry anoying because if I escape it before, then Spring hateaos reescape my %.
So I have to this and it's really horrible :
The text was updated successfully, but these errors were encountered: