Example usage for org.apache.wicket.request Request getFilterPath

List of usage examples for org.apache.wicket.request Request getFilterPath

Introduction

In this page you can find the example usage for org.apache.wicket.request Request getFilterPath.

Prototype

public String getFilterPath() 

Source Link

Document

Returns the path to which wicket Filter is mapped or an empty string if the filter is mapped to /* .

Usage

From source file:org.artifactory.common.wicket.util.WicketUtils.java

License:Open Source License

public static String getWicketAppPath() {
    Request request = RequestCycle.get().getRequest();
    return request.getContextPath() + request.getFilterPath() + "/";
}

From source file:org.artifactory.webapp.wicket.application.ArtifactoryRequestCycleListener.java

License:Open Source License

private void fixSimpleRepoBrowsingUrl(Request request, Url url) {
    RepoPath repoPath = RequestUtils.getRepoPath((HttpServletRequest) request.getContainerRequest());
    if (repoPath != null) {
        /*ArrayList<String> prefix = new ArrayList<String>();
        String path = repoPath.getPath();
        if (StringUtils.isNotEmpty(path)) {
        int nesting = new StringTokenizer(path, "/").countTokens() + 1;
        while (nesting > 0) {// w w  w  .  j  a  va2 s . co m
            prefix.add("..");
            nesting--;
        }
        } else {
        prefix.add("..");
        }
        */
        List<String> prefix = Lists.newArrayList("..");
        String filterPath = request.getFilterPath();
        if (StringUtils.isNotEmpty(filterPath) && filterPath.startsWith("/")) {
            prefix.add(filterPath.substring(1));
        }

        url.prependLeadingSegments(prefix);
    }
}