Package jodd.servlet.wrapper

Examples of jodd.servlet.wrapper.BufferResponseWrapper


    // content was buffered, so try to decorate it

    String actionPath = DispatcherUtil.getServletPath(request);
    String decoratorPath = decoraManager.resolveDecorator(request, actionPath);
    if (decoratorPath != null) {
      BufferResponseWrapper decoratorWrapper = new BufferResponseWrapper(response, lastModifiedData);
      DispatcherUtil.forward(decoraRequest, decoratorWrapper, decoratorPath);
      char[] decoraContent = decoratorWrapper.getBufferedChars();

      decoraParser.decorate(servletResponse.getWriter(), pageContent, decoraContent);

      decorated = true;
    }
View Full Code Here


  }*/

  public Object filter(ActionRequest actionRequest) throws Exception {
    HttpServletResponse httpResponse = actionRequest.getHttpServletResponse();

    BufferResponseWrapper wrapper = new BufferResponseWrapper(httpResponse);
    actionRequest.setHttpServletResponse(wrapper);

    Object result = actionRequest.invoke();

    wrapper.print("peep!");
    wrapper.writeContentToResponse();

    actionRequest.setHttpServletResponse(httpResponse);

    return result;
  }
View Full Code Here

    if (acceptActionPath(request, actionPath) == false) {
      filterChain.doFilter(servletRequest, servletResponse);
      return;
    }

    BufferResponseWrapper wrapper = new BufferResponseWrapper(response);
    filterChain.doFilter(servletRequest, wrapper);

    char[] content = wrapper.getBufferContentAsChars();

    if ((content != null) && (content.length != 0)) {
      if (log.isDebugEnabled()) {
        log.debug("Lagarto is about to parse: " + actionPath);
      }
      try {
        content = parse(content, request);
      } catch (Exception ex) {
        log.error("Error parsing", ex);
        throw new ServletException(ex);
      }

      wrapper.writeContentToResponse(content);
    }
  }
View Full Code Here

TOP

Related Classes of jodd.servlet.wrapper.BufferResponseWrapper

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.