Share this page 

Define a method in a JSP pageTag(s): Servlet/JSP


<%!
public String sayHello(){
    return "Hello";
}
%>


<%= sayHello() %>