Java Code Examples for org.springframework.web.servlet.support.ServletUriComponentsBuilder#queryParam()

The following examples show how to use org.springframework.web.servlet.support.ServletUriComponentsBuilder#queryParam() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: PasswordResetterImpl.java    From molgenis with GNU Lesser General Public License v3.0 5 votes vote down vote up
private URI createPasswordResetUri(String username, String token) {
  ServletUriComponentsBuilder builder = ServletUriComponentsBuilder.fromCurrentServletMapping();
  builder.encode();
  builder.path("/account/password/change");
  builder.queryParam("username", username);
  builder.queryParam("token", token);
  return builder.build().toUri();
}
 
Example 2
Source File: UriUtils.java    From molgenis with GNU Lesser General Public License v3.0 5 votes vote down vote up
private static UriComponents createEntitiesUriComponents(
    ServletUriComponentsBuilder builder,
    String entityTypeId,
    String idAttributeName,
    Collection<String> entityIds) {
  builder = builder.cloneBuilder();
  builder.path(ApiNamespace.API_PATH);
  builder.pathSegment(RestControllerV2.API_VERSION, entityTypeId);
  builder.queryParam("q", createEntitiesUriQuery(idAttributeName, entityIds));
  return builder.build();
}