Package org.springframework.web.util

Examples of org.springframework.web.util.UrlPathHelper


   * @see org.springframework.web.servlet.DispatcherServlet#noHandlerFound(javax.servlet.http.HttpServletRequest,
   *      javax.servlet.http.HttpServletResponse)
   */
  @Override
  protected void noHandlerFound(HttpServletRequest request, HttpServletResponse response) throws Exception {
    String requestUri = new UrlPathHelper().getRequestUri(request);
    throw new BadRequestException("No mapping found for HTTP request", requestUri, request.getParameterMap(),
        request.getMethod(), getServletName());
  }
View Full Code Here


   * Exposes the DispatcherServlet-specific request attributes and
   * delegates to {@link #doDispatch} for the actual dispatching.
   */
  protected void doService(HttpServletRequest request, HttpServletResponse response) throws Exception {
    if (logger.isDebugEnabled()) {
      String requestUri = new UrlPathHelper().getRequestUri(request);
      logger.debug("DispatcherServlet with name '" + getServletName() +
          "' processing request for [" + requestUri + "]");
    }

    // Keep a snapshot of the request attributes in case of an include,
View Full Code Here

   * Override HttpServlet's <code>getLastModified</code> method to evaluate
   * the Last-Modified value of the mapped handler.
   */
  protected long getLastModified(HttpServletRequest request) {
    if (logger.isDebugEnabled()) {
      String requestUri = new UrlPathHelper().getRequestUri(request);
      logger.debug("DispatcherServlet with name '" + getServletName() +
          "' determining Last-Modified value for [" + requestUri + "]");
    }
    try {
      HandlerExecutionChain mappedHandler = getHandler(request, true);
      if (mappedHandler == null || mappedHandler.getHandler() == null) {
        // Ignore -> will reappear on doService.
        logger.debug("No handler found in getLastModified");
        return -1;
      }

      HandlerAdapter ha = getHandlerAdapter(mappedHandler.getHandler());
      long lastModified = ha.getLastModified(request, mappedHandler.getHandler());
      if (logger.isDebugEnabled()) {
        String requestUri = new UrlPathHelper().getRequestUri(request);
        logger.debug("Last-Modified value for [" + requestUri + "] is: " + lastModified);
      }
      return lastModified;
    }
    catch (Exception ex) {
View Full Code Here

   * @param response current HTTP response
   * @throws Exception if preparing the response failed
   */
  protected void noHandlerFound(HttpServletRequest request, HttpServletResponse response) throws Exception {
    if (pageNotFoundLogger.isWarnEnabled()) {
      String requestUri = new UrlPathHelper().getRequestUri(request);
      pageNotFoundLogger.warn("No mapping found for HTTP request with URI [" +
          requestUri + "] in DispatcherServlet with name '" + getServletName() + "'");
    }
    response.sendError(HttpServletResponse.SC_NOT_FOUND);
  }
View Full Code Here

    // Determine default HTML escape setting from the "defaultHtmlEscape"
    // context-param in web.xml, if any.
    this.defaultHtmlEscape = WebUtils.getDefaultHtmlEscape(this.webApplicationContext.getServletContext());

    this.urlPathHelper = new UrlPathHelper();
  }
View Full Code Here

  /**
   * 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

                logger.debug("short-circuit: found portalRequestInfo within request attributes");
            }
            return portalRequestInfo;
        }
       
        final String requestPath = new UrlPathHelper().getPathWithinApplication(request);
        // first pass looks for absence of state
        Matcher firstPass = NO_STATE_PATTERN.matcher(requestPath);
        if(!firstPass.matches()) {
          // requestPath doesn't contain state
          // assume NORMAL state, not an action
View Full Code Here

    // Determine default HTML escape setting from the "defaultHtmlEscape"
    // context-param in web.xml, if any.
    this.defaultHtmlEscape = WebUtils.getDefaultHtmlEscape(this.webApplicationContext.getServletContext());

    this.urlPathHelper = new UrlPathHelper();
  }
View Full Code Here

   * Exposes the DispatcherServlet-specific request attributes and
   * delegates to {@link #doDispatch} for the actual dispatching.
   */
  protected void doService(HttpServletRequest request, HttpServletResponse response) throws Exception {
    if (logger.isDebugEnabled()) {
      String requestUri = new UrlPathHelper().getRequestUri(request);
      logger.debug(
          "DispatcherServlet with name '" + getServletName() + "' received request for [" + requestUri + "]");
    }

    // Keep a snapshot of the request attributes in case of an include,
View Full Code Here

      }

      HandlerAdapter ha = getHandlerAdapter(mappedHandler.getHandler());
      long lastModified = ha.getLastModified(request, mappedHandler.getHandler());
      if (logger.isDebugEnabled()) {
        String requestUri = new UrlPathHelper().getRequestUri(request);
        logger.debug("Last-Modified value for [" + requestUri + "] is: " + lastModified);
      }
      return lastModified;
    }
    catch (Exception ex) {
View Full Code Here

TOP

Related Classes of org.springframework.web.util.UrlPathHelper

Copyright © 2018 www.massapicom. 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.