title: Are methods legal inside JSP scriptlet?
body: <p>I know its not recommended, and I should be using tag libraries etc etc.</p>
  
  <p>But I'd still like to know if it is legal to declare methods in a JSP scriplet:</p>
  
  <pre><code>&lt;%
     public String doSomething(String param) {
        //
     }
  
     String test = doSomething("test");
  
  %&gt;
  </code></pre>
  
  <p>Is that legal? I am getting some weird compile errors (like <code>a ; is expected</code>) that don't seem to fit. Thanks.</p>