title: Output buffer to get current page code like ob_get_contents() of PHP in JSP
body: <p>I need get the entire HTML source code of page after process in JSP.</p>
  
  <p>in PHP:</p>
  
  <pre><code>&lt;?php
  ob_start();
  ?&gt;
  
  {home}
  {car}
  {light}
  
  &lt;?php
  $page = ob_get_contents(); // &lt;&lt;&lt; I need that in JSP
  
  ob_clean();
  
  $page = str_replace("{home}", "Home", $page);
  $page = str_replace("{car}", "Car", $page);
  $page = str_replace("{light}", "Light", $page);
  
  echo($page);
  ?&gt;
  </code></pre>
  
  <p>How i can get the output buffer in JSP?</p>
  
  <p>I try:</p>
  
  <pre><code>String ob = pageContext.pushBody().getString();
  </code></pre>
  
  <p>But not work.</p>
  
  <p>It's possible make that using Java inside JSP page?</p>
  
  <p>Thanks.</p>