Example usage for javax.servlet.http HttpServletResponseWrapper toString

List of usage examples for javax.servlet.http HttpServletResponseWrapper toString

Introduction

In this page you can find the example usage for javax.servlet.http HttpServletResponseWrapper toString.

Prototype

public String toString() 

Source Link

Document

Returns a string representation of the object.

Usage

From source file:com.jsmartframework.web.manager.FilterControl.java

private String completeHtml(HttpServletRequest httpRequest, HttpServletResponseWrapper response) {
    String html = response.toString();

    // Ajax request do not use scripts returned on html body
    if ("XMLHttpRequest".equals(httpRequest.getHeader("X-Requested-With"))) {
        return html;
    }//from w w  w .  j  a v a 2 s.c o  m

    // Check if it is a valid html, if not just return the html
    Matcher htmlMatcher = HTML_PATTERN.matcher(html);
    if (!htmlMatcher.find()) {
        return html;
    }

    html = completeHeader(httpRequest, htmlMatcher, html);
    html = completeScripts(httpRequest, html);
    html = completeVersions(httpRequest, html);
    return html;
}