Example usage for javax.servlet.http HttpServletRequest getRequestURI

List of usage examples for javax.servlet.http HttpServletRequest getRequestURI

Introduction

In this page you can find the example usage for javax.servlet.http HttpServletRequest getRequestURI.

Prototype

public String getRequestURI();

Source Link

Document

Returns the part of this request's URL from the protocol name up to the query string in the first line of the HTTP request.

Usage

From source file:org.apereo.openlrs.model.error.XAPIErrorInfo.java

private void getDataFromRequest(final HttpServletRequest request) {
    this.path = request.getRequestURI();
    this.method = request.getMethod();
    this.parameters = request.getParameterMap();
}

From source file:com.googlesource.gerrit.plugins.github.oauth.OAuthFilter.java

private boolean isRpcCall(HttpServletRequest httpRequest) {
    return httpRequest.getRequestURI().indexOf("/rpc/") >= 0;
}

From source file:com.hp.autonomy.frontend.find.core.view.AbstractViewController.java

private String getBaseUrl(final HttpServletRequest request) {
    final String path = request.getRequestURI().replaceFirst(request.getContextPath(), "");

    final int depth = StringUtils.countMatches(path, "/") - 1;

    final String baseUrl;

    if (depth == 0) {
        baseUrl = ".";
    } else {//from  w  w w  .  ja  v a  2  s .  co  m
        baseUrl = StringUtils.repeat("../", depth);
    }

    return baseUrl;
}

From source file:com.microservice.training.hal.HalBrowser.java

/**
 * Redirects to the actual {@code index.html}.
 * /*from   www  . j a  v a 2s .  co  m*/
 * @return
 */
@RequestMapping(value = "/browser", method = RequestMethod.GET)
public View browser(HttpServletRequest request) {
    return getRedirectView(request, request.getRequestURI().endsWith("/browser"));
}

From source file:nl.surfnet.coin.selfservice.interceptor.MenuInterceptor.java

private void setSelected(HttpServletRequest request, Menu menu) {
    String requestURI = request.getRequestURI();
    List<MenuItem> menuItems = menu.getMenuItems();
    for (MenuItem menuItem : menuItems) {
        if (requestURI.endsWith(menuItem.getUrl())) {
            menuItem.setSelected(true);//from w ww  . j ava  2 s.  c o m
            break;
        }
    }
}

From source file:org.cee.highlighter.impl.ContentHighlightHandler.java

private ArticleKey getArticleKey(HttpServletRequest request) {
    String url = request.getRequestURI();
    String[] pathFragments = url.split("/");
    int articleKeyIndex = pathFragments.length - 1;
    int siteKeyIndex = pathFragments.length - 2;
    String articleKey = decode(pathFragments[articleKeyIndex]);
    String siteKey = decode(pathFragments[siteKeyIndex]);
    return ArticleKey.get(null, articleKey, siteKey);
}

From source file:edu.usu.sdl.openstorefront.web.init.AngularRewriteRule.java

@Override
public RewriteMatch matches(HttpServletRequest request, HttpServletResponse response) {
    String actionPath = request.getRequestURI().replace(request.getContextPath() + "/", "");
    if (StringUtils.isNotBlank(actionPath)) {
        if (actionPath.contains("/") == false) {
            if (actionPath.contains(".") == false) {
                return new AngularRewriteMatch();
            }/*from ww  w. ja v  a 2  s  .  c om*/
        }
    }
    return null;
}

From source file:org.jasig.cas.web.flow.CasDefaultFlowUrlHandler.java

@Override
public String createFlowExecutionUrl(final String flowId, final String flowExecutionKey,
        final HttpServletRequest request) {
    final StringBuffer builder = new StringBuffer();
    builder.append(request.getRequestURI());
    builder.append("?");
    appendQueryParameters(builder, request.getParameterMap(), getEncodingScheme(request));
    return builder.toString();
}

From source file:com.envisioncn.it.super_sonic.showcase.support.LoginInterceptor.java

@Override
public boolean preHandle(HttpServletRequest req, HttpServletResponse res, Object handler) throws Exception {
    String uri = req.getRequestURI();
    if (!uri.startsWith("/resources/") && !uri.startsWith("/icon/") && !uri.startsWith("/pre_login")
            && !uri.startsWith("/login")) {
        HttpSession session = req.getSession();
        String user = SessionUtil.getUser(session);
        if (StringUtils.isEmpty(user)) {
            res.sendRedirect("/pre_login");
            return false;
        }// ww  w  .  j  av a 2 s .  c o m
    }
    return true;

}

From source file:newcontroller.RouterHandlerMapping.java

@Override
protected Object getHandlerInternal(HttpServletRequest request) throws Exception {
    if (request.getRequestURI().equalsIgnoreCase("favicon.ico")) {
        return null;
    }//www .  j a v  a 2 s.c o  m
    String method = request.getMethod();
    String path = request.getRequestURI();
    return this.router.match(method, path);
}