I know its not recommended, and I should be using tag libraries etc etc.
But I\'d still like to know if it is legal to declare methods in a JSP scriplet:
You need to use declaration syntax (<%! ... %>):
<%! ... %>
<%! public String doSomething(String param) { // } %> <% String test = doSomething("test"); %>