Examples of UrlPathHelper


Examples of org.springframework.web.util.UrlPathHelper

   *
   * @param request
   * @return
   */
  public static String getLocation(HttpServletRequest request) {
    UrlPathHelper helper = new UrlPathHelper();
    StringBuffer buff = request.getRequestURL();
    String uri = request.getRequestURI();
    String origUri = helper.getOriginatingRequestUri(request);
    buff.replace(buff.length() - uri.length(), buff.length(), origUri);
    String queryString = helper.getOriginatingQueryString(request);
    if (queryString != null) {
      buff.append("?").append(queryString);
    }
    return buff.toString();
  }
View Full Code Here

Examples of org.springframework.web.util.UrlPathHelper

  public static String[] getParams(HttpServletRequest request) {
    return getParams(getURI(request));
  }

  private static String getURI(HttpServletRequest request) {
    UrlPathHelper helper = new UrlPathHelper();
    String uri = helper.getOriginatingRequestUri(request);
    String ctx = helper.getOriginatingContextPath(request);
    if (!StringUtils.isBlank(ctx)) {
      return uri.substring(ctx.length());
    } else {
      return uri;
    }
View Full Code Here

Examples of org.springframework.web.util.UrlPathHelper

   *
   * @param request
   * @return
   */
  public static PageInfo getPageInfo(HttpServletRequest request) {
    UrlPathHelper helper = new UrlPathHelper();
    String uri = helper.getOriginatingRequestUri(request);
    String queryString = helper.getOriginatingQueryString(request);
    return getPageInfo(uri, queryString);
  }
View Full Code Here

Examples of org.springframework.web.util.UrlPathHelper

   * @throws IllegalStateException
   *             访问路径错误,没有三()'/'
   */
  private static String getURI(HttpServletRequest request)
      throws IllegalStateException {
    UrlPathHelper helper = new UrlPathHelper();
    String uri = helper.getOriginatingRequestUri(request);
    String ctxPath = helper.getOriginatingContextPath(request);
    int start = 0, i = 0, count = 2;
    if (!StringUtils.isBlank(ctxPath)) {
      count++;
    }
    while (i < count && start != -1) {
View Full Code Here

Examples of org.springframework.web.util.UrlPathHelper

  }

  public CmsLog loginSuccess(HttpServletRequest request, CmsUser user,
      String title) {
    String ip = RequestUtils.getIpAddr(request);
    UrlPathHelper helper = new UrlPathHelper();
    String uri = helper.getOriginatingRequestUri(request);
    Date date = new Date();
    CmsLog log = save(CmsLog.LOGIN_SUCCESS, null, user, uri, ip, date,
        MessageResolver.getMessage(request, title), null);
    return log;
  }
View Full Code Here

Examples of org.springframework.web.util.UrlPathHelper

  }

  public CmsLog loginFailure(HttpServletRequest request, String title,
      String content) {
    String ip = RequestUtils.getIpAddr(request);
    UrlPathHelper helper = new UrlPathHelper();
    String uri = helper.getOriginatingRequestUri(request);
    Date date = new Date();
    CmsLog log = save(CmsLog.LOGIN_FAILURE, null, null, uri, ip, date,
        MessageResolver.getMessage(request, title), content);
    return log;
  }
View Full Code Here

Examples of org.springframework.web.util.UrlPathHelper

  public CmsLog operating(HttpServletRequest request, String title,
      String content) {
    CmsSite site = CmsUtils.getSite(request);
    CmsUser user = CmsUtils.getUser(request);
    String ip = RequestUtils.getIpAddr(request);
    UrlPathHelper helper = new UrlPathHelper();
    String uri = helper.getOriginatingRequestUri(request);
    Date date = new Date();
    CmsLog log = save(CmsLog.OPERATING, site, user, uri, ip, date,
        MessageResolver.getMessage(request, title), content);
    return log;
  }
View Full Code Here

Examples of org.springframework.web.util.UrlPathHelper

  /**
   * Create a new NoSuchRequestHandlingMethodException for the given request.
   * @param request the offending HTTP request
   */
  public NoSuchRequestHandlingMethodException(HttpServletRequest request) {
    this(new UrlPathHelper().getRequestUri(request), request.getMethod(), request.getParameterMap());
  }
View Full Code Here

Examples of org.springframework.web.util.UrlPathHelper

  @Test
  public void handlerMapping() {
    SimpleUrlHandlerMapping hm = (SimpleUrlHandlerMapping) this.endpointRegistry.getHandlerMapping();
    assertEquals(0, hm.getUrlMap().size());

    UrlPathHelper pathHelper = new UrlPathHelper();
    this.endpointRegistry.setUrlPathHelper(pathHelper);
    this.endpointRegistry.addEndpoint("/stompOverWebSocket");
    this.endpointRegistry.addEndpoint("/stompOverSockJS").withSockJS();

    hm = (SimpleUrlHandlerMapping) this.endpointRegistry.getHandlerMapping();
View Full Code Here

Examples of org.springframework.web.util.UrlPathHelper

  private PatternsRequestCondition(Collection<String> patterns, UrlPathHelper urlPathHelper,
      PathMatcher pathMatcher, boolean useSuffixPatternMatch, boolean useTrailingSlashMatch,
      List<String> fileExtensions) {

    this.patterns = Collections.unmodifiableSet(prependLeadingSlash(patterns));
    this.pathHelper = urlPathHelper != null ? urlPathHelper : new UrlPathHelper();
    this.pathMatcher = pathMatcher != null ? pathMatcher : new AntPathMatcher();
    this.useSuffixPatternMatch = useSuffixPatternMatch;
    this.useTrailingSlashMatch = useTrailingSlashMatch;
    if (fileExtensions != null) {
      for (String fileExtension : fileExtensions) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.