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:com.surevine.alfresco.audit.listeners.CreateDocumentCommentAuditEventListener.java

@Override
public boolean isEventFired(final HttpServletRequest request) {
    return request.getRequestURI().contains(URI_DESIGNATOR) && request.getRequestURI().contains("comments");
}

From source file:com.kolich.havalo.filters.HavaloAuthenticationFilter.java

private static final String getStringToSign(final HttpServletRequest request) {
    final StringBuilder sb = new StringBuilder();
    // HTTP-Verb (GET, PUT, POST, or DELETE) + "\n"
    sb.append(request.getMethod().toUpperCase()).append(LINE_SEPARATOR_UNIX);
    // RFC822 Date (from 'Date' request header, must exist) + "\n" +
    final String dateHeader;
    if ((dateHeader = request.getHeader(DATE)) == null) {
        throw new BadCredentialsException(
                "Incoming request missing " + "required '" + DATE + "' request header.");
    }/*from w  ww .  j  ava 2  s .  co m*/
    sb.append(dateHeader).append(LINE_SEPARATOR_UNIX);
    // Content-Type (from 'Content-Type' request header, optional) + "\n" +
    final String contentType;
    if ((contentType = request.getHeader(CONTENT_TYPE)) != null) {
        sb.append(contentType);
    }
    sb.append(LINE_SEPARATOR_UNIX);
    // CanonicalizedResource
    sb.append(request.getRequestURI());
    return sb.toString();
}

From source file:com.trenako.web.infrastructure.ServletRequestPathVariablesPropertyValues.java

/**
 * Creates a new {@code ServletRequestPathVariablesPropertyValues} from
 * the provided {@code ServletRequest}./*from  w w w.  j a  v a 2s.co  m*/
 *
 * @param servletRequest the {@code ServletRequest}
 */
public ServletRequestPathVariablesPropertyValues(HttpServletRequest servletRequest) {
    super(SearchRequestUrlParser.parseUrl(servletRequest.getRequestURI()));
}

From source file:grails.plugin.springsecurity.web.authentication.FilterProcessUrlRequestMatcher.java

public boolean matches(final HttpServletRequest request) {
    String uri = request.getRequestURI();
    int pathParamIndex = uri.indexOf(';');

    if (pathParamIndex > 0) {
        // strip everything after the first semi-colon
        uri = uri.substring(0, pathParamIndex);
    }//from w  w  w  .  ja  va  2s  .c o  m

    if ("".equals(request.getContextPath())) {
        return uri.endsWith(filterProcessesUrl);
    }

    return uri.endsWith(request.getContextPath() + filterProcessesUrl);
}

From source file:info.rmapproject.webapp.utils.UrlPathHelperNonDecoding.java

@Override
public String getOriginatingServletPath(HttpServletRequest request) {
    String servletPath = request.getRequestURI().substring(request.getContextPath().length());
    return servletPath;
}

From source file:com.antonjohansson.managementcenter.core.web.VaadinResourcesServlet.java

private String getRequestURI(HttpServletRequest request) {
    String requestURI = request.getRequestURI();
    if (requestURI.startsWith(CONTEXT)) {
        requestURI = requestURI.substring(CONTEXT.length());
    }//w w w .jav a  2  s.  co  m
    return requestURI;
}

From source file:fr.hoteia.qalingo.web.handler.security.ExtUsernamePasswordAuthenticationFilter.java

@Override
protected boolean requiresAuthentication(HttpServletRequest request, HttpServletResponse response) {
    String uri = request.getRequestURI();
    int pathParamIndex = uri.indexOf(';');

    if (pathParamIndex > 0) {
        // strip everything after the first semi-colon
        uri = uri.substring(0, pathParamIndex);
    }//from  ww  w . ja v a  2 s .  com

    boolean requiresAuthentication = false;
    if (StringUtils.isNotEmpty(uri)) {
        requiresAuthentication = uri.contains(getFilterProcessesUrl());
    }
    return requiresAuthentication;
}

From source file:com.surevine.alfresco.audit.listeners.CreateFolderAuditEventListener.java

@Override
public boolean isEventFired(final HttpServletRequest request) {
    return request.getRequestURI().contains(URI_DESIGNATOR);
}

From source file:com.digitalmisfits.support.compat.jasig.cas.web.flow.CasDefaultFlowUrlHandler.java

@Override
public String createFlowDefinitionUrl(final String flowId, final AttributeMap input,
        final HttpServletRequest request) {
    return request.getRequestURI() + (request.getQueryString() != null ? "?" + request.getQueryString() : "");
}

From source file:br.com.munif.ffjma.FreeFormApi.java

private String getCollection(HttpServletRequest req) {
    String uri = req.getRequestURI();
    return uri.replaceFirst(".*/api/", "").replaceFirst("/.*", "");
}