title: out.print not working in java method in jsp
body: <p>I have a pretty weird problem, here it goes:</p>
  
  <p>I have a jsp page, in this jsp, there is an iframe showing some content from another jsp. I want this iframe to be refreshed in the <code>&lt;body onload="blabla"..&gt;</code></p>
  
  <p>So what I tried to do is, I converted the static HTML iframe code into a java code in a method. So it was like this:</p>
  
  <p>.
  .
  html here ...</p>
  
  <pre><code>&lt;iframe ... blabla&gt;
  &lt;/iframe
  </code></pre>
  
  <p>html here..
  .
  .</p>
  
  <p>And I did it like:</p>
  
  <pre><code>&lt;body onload="refreshiframe();"&gt;
  </code></pre>
  
  <p>.
  .
  html here ...</p>
  
  <pre><code>&lt;%! void refreshiframe()
  {
  out.print("&lt;iframe.. blabla&gt; &lt;/iframe&gt;");
  }
  %&gt;
  </code></pre>
  
  <p>html here ...
  .
  .</p>
  
  <p>But the problem is, the out.print inside refreshiframe gives compile error. My compiler, jdeveloper 10g, specifically says that "variable 'out' not found". I can use out.print outside of the method but not inside the method. How can I use out.print in the refreshiframe() method ? or is there a better way to solve this problem ? Thank you. </p>