Example usage for org.springframework.web.util UriComponentsBuilder fromPath

List of usage examples for org.springframework.web.util UriComponentsBuilder fromPath

Introduction

In this page you can find the example usage for org.springframework.web.util UriComponentsBuilder fromPath.

Prototype

public static UriComponentsBuilder fromPath(String path) 

Source Link

Document

Create a builder that is initialized with the given path.

Usage

From source file:org.wallride.support.PostUtils.java

public String path(Page page, boolean encode) {
    UriComponentsBuilder builder = UriComponentsBuilder.fromPath("");
    return path(builder, page, encode);
}

From source file:com.company.eleave.leave.rest.HolidayController.java

@RequestMapping(method = RequestMethod.POST)
public ResponseEntity<Long> createNew(@RequestBody HolidayDTO holiday) {
    final long holidayId = holidayService.createNew(mapper.toEntity(holiday));

    HttpHeaders headers = new HttpHeaders();
    headers.setLocation(UriComponentsBuilder.fromPath("/leaveTypes/{id}").buildAndExpand(holidayId).toUri());

    return new ResponseEntity<>(headers, HttpStatus.CREATED);
}

From source file:cherry.example.web.form.ex10.FormEx10ControllerImpl.java

private UriComponents redirectOnInit(String redir) {
    if (StringUtils.isNotEmpty(redir)) {
        return UriComponentsBuilder.fromPath(redir).build();
    } else {/*from  w  ww .  j av a  2 s .  c  om*/
        return fromMethodCall(on(FormEx10Controller.class).start(null, null, null, null, null, null)).build();
    }
}

From source file:cherry.example.web.form.ex20.FormEx20ControllerImpl.java

private UriComponents redirectOnInit(String redir) {
    if (StringUtils.isNotEmpty(redir)) {
        return UriComponentsBuilder.fromPath(redir).build();
    } else {//from  w  w w  .ja v a2 s.c  o  m
        return fromMethodCall(on(FormEx20Controller.class).start(null, null, null, null, null, null)).build();
    }
}

From source file:cherry.example.web.form.ex30.FormEx30ControllerImpl.java

private UriComponents redirectOnInit(String redir) {
    if (StringUtils.isNotEmpty(redir)) {
        return UriComponentsBuilder.fromPath(redir).build();
    } else {/*from  w  w  w.  j ava  2s. c  om*/
        return fromMethodCall(on(FormEx30Controller.class).start(null, null, null, null, null, null)).build();
    }
}

From source file:cherry.example.web.form.ex40.FormEx40ControllerImpl.java

private UriComponents redirectOnInit(String redir) {
    if (StringUtils.isNotEmpty(redir)) {
        return UriComponentsBuilder.fromPath(redir).build();
    } else {//from   w ww .j ava  2  s  .c  o m
        return fromMethodCall(on(FormEx40Controller.class).start(null, null, null, null, null, null)).build();
    }
}

From source file:cherry.example.web.form.ex50.FormEx50ControllerImpl.java

private UriComponents redirectOnInit(String redir) {
    if (StringUtils.isNotEmpty(redir)) {
        return UriComponentsBuilder.fromPath(redir).build();
    } else {/*from   w w  w .  ja v  a2 s.  co m*/
        return fromMethodCall(on(FormEx50Controller.class).start(null, null, null, null, null, null)).build();
    }
}

From source file:cherry.example.web.validation.ex10.ValidationEx10ControllerImpl.java

private UriComponents redirectOnInit(String redir) {
    if (StringUtils.isNotEmpty(redir)) {
        return UriComponentsBuilder.fromPath(redir).build();
    } else {//from  w  w  w .  j av  a2s  .c om
        return fromMethodCall(on(ValidationEx10Controller.class).start(null, null, null, null, null, null))
                .build();
    }
}

From source file:cherry.example.web.validation.ex20.ValidationEx20ControllerImpl.java

private UriComponents redirectOnInit(String redir) {
    if (StringUtils.isNotEmpty(redir)) {
        return UriComponentsBuilder.fromPath(redir).build();
    } else {// www . j  a  v a  2s.  c  o  m
        return fromMethodCall(on(ValidationEx20Controller.class).start(null, null, null, null, null, null))
                .build();
    }
}

From source file:cherry.example.web.validation.ex30.ValidationEx30ControllerImpl.java

private UriComponents redirectOnInit(String redir) {
    if (StringUtils.isNotEmpty(redir)) {
        return UriComponentsBuilder.fromPath(redir).build();
    } else {//from w  w  w.j a v  a 2  s.c  o m
        return fromMethodCall(on(ValidationEx30Controller.class).start(null, null, null, null, null, null))
                .build();
    }
}