Inside a JSP, how to represent private methods and call them?
Created May 8, 2012
Luigi Viggiano [I wrote a servlet, and I want to convert it to a JSP file.
Usually it is very simple - all of the code of the "doGet" method directly goes into the JSP.
But now I have a private method in that servlet, that the doGet method calls with various arguments.
How do I put that in a jsp?
]
Use a declaration scriptlet:
<%!
private void foo() {
System.out.println("foo");
}
%>
<%
foo();
%>