JSP text will become a servlet file after compiling Application Server, so carefully studying the servlet specification is a passive way to master JSP.
To learn Servlet, it is best to learn from an instance, here I recommend Struts.
You can download Struts source code or binary package http://struts.apache.org/
The key code section of the Struts source code you downloaded, under the path / src / share.
The struts key process is primarily in org.Apache.struts.Action.ActionServlet.java and org.apache.struts.Action.RequestProcessor.java in two classes.