JSP/Java/HTML | JSP out.println(); prints to console when in method
<p>I'm working a dynamic website with jsp.</p>

<p>Now my problem: when I use <code>&lt;%</code>, to write my java, everything works perfectly fine.</p>

<pre><code>&lt;%
   out.println("&lt;p&gt;test&lt;/p&gt;");
%&gt;
</code></pre>

<p>But when i use the <code>&lt;%!</code> like this:</p>

<pre><code>&lt;%!
  private void test() {
   out.println("&lt;p&gt;test&lt;/p&gt;");
}
%&gt;
</code></pre>

<p>My output will get displayed in my code editors console and not on my website as expected.</p>

<p>As import I used <code>&lt;%@ page import="static java.lang.System.out" %&gt;</code>. Is this the correct import or is the problem somewhere else?</p>

<p>If more information is needed please comment! :)</p>