Package org.springframework.web.servlet.support

Examples of org.springframework.web.servlet.support.ServletUriComponentsBuilder.build()


      return true;
    }

    if (requestMappingPatterns.contains(pattern.substring(0, pattern.length() - 1))) {
      ServletUriComponentsBuilder builder = ServletUriComponentsBuilder.fromRequest(request);
      String path = builder.build().getPath();
      builder.replacePath(path.substring(0, path.length() - 1));
      String location = builder.build().toString();

      response.setStatus(HttpStatus.MOVED_PERMANENTLY.value());
      response.setHeader("Location", location);
View Full Code Here


    if (requestMappingPatterns.contains(pattern.substring(0, pattern.length() - 1))) {
      ServletUriComponentsBuilder builder = ServletUriComponentsBuilder.fromRequest(request);
      String path = builder.build().getPath();
      builder.replacePath(path.substring(0, path.length() - 1));
      String location = builder.build().toString();

      response.setStatus(HttpStatus.MOVED_PERMANENTLY.value());
      response.setHeader("Location", location);
      return false;
    }
View Full Code Here

*/
public class LinkBuilder {

  public static Link build(String requestMapping, String name, String rel) {
    ServletUriComponentsBuilder builder = ServletUriComponentsBuilder.fromCurrentServletMapping();
    String root = builder.build().toString();
    String href = root + requestMapping;
    return new Link(name, href, rel);
  }

  public static Link build(String requestMapping, String name) {
View Full Code Here

    return new Link(name, href, rel);
  }

  public static Link build(String requestMapping, String name) {
    ServletUriComponentsBuilder builder = ServletUriComponentsBuilder.fromCurrentServletMapping();
    String root = builder.build().toString();
    String href = root + requestMapping;
    return new Link(name, href, Link.REL_SELF);
  }
}
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.