public class Test extends HttpServlet {
private static final long serialVersionUID = 1L;
public Test() {
super();
}
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
PrintWriter out = response.getWriter();
out.println("<HTML><HEAD><TITLE>MovieDB</TITLE></HEAD>");
out.println("<BODY><H1>MovieDB</H1>");
out.println("<a href = '#' onclick = 'on_Click();'> Call Function </a>");
}
public void on_Click()
{
System.out.println("HELLO");
}
}
I just want the HTML Link on my page to call my java function on_Click(), what is a good way to do this?