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.web.controller.admin.customfield.CustomFieldSearchController.java

@RequestMapping(params = "query")
public String search(@PathVariable String language, String query, Model model, SessionStatus sessionStatus,
        RedirectAttributes redirectAttributes) {
    sessionStatus.setComplete();/* w w  w.  j  av  a2 s .  co  m*/

    for (Map.Entry<String, Object> mapEntry : model.asMap().entrySet()) {
        redirectAttributes.addFlashAttribute(mapEntry.getKey(), mapEntry.getValue());
    }
    String url = UriComponentsBuilder.fromPath("/_admin/{language}/customfields/index").query(query)
            .buildAndExpand(language).encode().toUriString();
    return "redirect:" + url;
}

From source file:cherry.sqlman.tool.password.PasswordChangeControllerImpl.java

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

From source file:org.wallride.web.support.DefaultModelAttributeInterceptor.java

private String buildGuestPath(String currentLanguage, List<String> languages) {
    UriComponentsBuilder builder = UriComponentsBuilder.fromPath("");
    if (languages.size() > 1) {
        builder.path("/{language}");
    }//from ww  w.  j  a v a2s. co m
    return builder.buildAndExpand(currentLanguage).toUriString();
}

From source file:cherry.example.web.applied.ex10.AppliedEx11ControllerImpl.java

private UriComponents redirectOnInit(String redir, int rownum) {
    if (StringUtils.isNotEmpty(redir)) {
        return UriComponentsBuilder.fromPath(redir).build();
    } else {//www  .  j a v a2s .  co  m
        return fromMethodCall(on(AppliedEx11Controller.class).start(rownum, null, null, null, null, null, null))
                .replaceQueryParam(REQ_ROWNUM, rownum).build();
    }
}

From source file:cherry.example.web.applied.ex20.AppliedEx21ControllerImpl.java

private UriComponents redirectOnInit(String redir, int rownum) {
    if (StringUtils.isNotEmpty(redir)) {
        return UriComponentsBuilder.fromPath(redir).build();
    } else {/*from ww  w .j ava  2s .  com*/
        return fromMethodCall(on(AppliedEx21Controller.class).start(rownum, null, null, null, null, null, null))
                .replaceQueryParam(REQ_ROWNUM, rownum).build();
    }
}

From source file:org.wallride.web.controller.admin.user.UserSearchController.java

@RequestMapping(params = "query")
public String search(@PathVariable String language, String query, Model model, SessionStatus sessionStatus,
        RedirectAttributes redirectAttributes) {
    sessionStatus.setComplete();/*  ww w.  ja  v  a 2s  .  c  o  m*/

    for (Map.Entry<String, Object> mapEntry : model.asMap().entrySet()) {
        redirectAttributes.addFlashAttribute(mapEntry.getKey(), mapEntry.getValue());
    }
    String url = UriComponentsBuilder.fromPath("/_admin/{language}/users/index").query(query)
            .buildAndExpand(language).encode().toUriString();
    return "redirect:" + url;
}

From source file:org.wallride.web.controller.admin.tag.TagSearchController.java

@RequestMapping(params = "query")
public String search(@PathVariable String language, String query, Model model, SessionStatus sessionStatus,
        RedirectAttributes redirectAttributes) {
    sessionStatus.setComplete();//from ww w .  j a  va 2s .c  o m

    for (Map.Entry<String, Object> mapEntry : model.asMap().entrySet()) {
        redirectAttributes.addFlashAttribute(mapEntry.getKey(), mapEntry.getValue());
    }
    String url = UriComponentsBuilder.fromPath("/_admin/{language}/tags/index").query(query)
            .buildAndExpand(language).encode().toUriString();
    return "redirect:" + url;
}

From source file:cherry.example.web.applied.ex10.AppliedEx13ControllerImpl.java

private UriComponents redirectOnInit(String redir, long id, int rownum) {
    if (StringUtils.isNotEmpty(redir)) {
        return UriComponentsBuilder.fromPath(redir).build();
    } else {/*w w  w . j a  v  a 2  s  .co m*/
        return fromMethodCall(
                on(AppliedEx13Controller.class).start(id, rownum, null, null, null, null, null, null))
                        .replaceQueryParam(REQ_ID, id).replaceQueryParam(REQ_ROWNUM, rownum).build();
    }
}

From source file:cherry.example.web.applied.ex20.AppliedEx23ControllerImpl.java

private UriComponents redirectOnInit(String redir, long id, int rownum) {
    if (StringUtils.isNotEmpty(redir)) {
        return UriComponentsBuilder.fromPath(redir).build();
    } else {/*from   ww  w . ja  v  a 2s  . com*/
        return fromMethodCall(
                on(AppliedEx23Controller.class).start(id, rownum, null, null, null, null, null, null))
                        .replaceQueryParam(REQ_ID, id).replaceQueryParam(REQ_ROWNUM, rownum).build();
    }
}

From source file:cherry.example.web.applied.ex30.AppliedEx32ControllerImpl.java

private UriComponents redirectOnInit(String redir, long id, int rownum) {
    if (StringUtils.isNotEmpty(redir)) {
        return UriComponentsBuilder.fromPath(redir).build();
    } else {// www . j av  a2s .  c  o m
        return fromMethodCall(
                on(AppliedEx32Controller.class).start(id, rownum, null, null, null, null, null, null))
                        .replaceQueryParam(REQ_ID, id).replaceQueryParam(REQ_ROWNUM, rownum).build();
    }
}