I have written the following jsp code in a jsp page for testing
<%!
public String sayHello(String myName)
{
out.println("Hello Java"); // this line shows error
return "Hello"+myName;
}
%>
<%
String str="William";
%>
<%=sayHello(str)%>
If i remove the following line the page runs without error
out.println("Hello Java");
Again, if i run a jsp file with only the following line included (not above codes) then also it runs well
out.println("Hello Java");
Please help me where am i doing mistakes