In the end, a JSP is just a servlet.

  The Container generates a class from your JSP that implements the HttpJspPage interface. This is the only part of the generated servlet’s API that you need to

know. You don’t care that in Tomcat, for example, your generated servlet extends: org.apache.jasper.runtime.HttpJspBase. All you need to know about are the three key methods: jspInit(), jspDestroy(), _jspService().

  JSP Element Magnets: directive, declaration, EL expression, scriptlet, expression, action.