This week's book giveaway is in the Agile and Other Processes forum.We're giving away four copies of The Little Book of Impediments (e-book only) and have Tom Perry on-line!See this thread for details.

A servlet generated from jsp implements the HttpJspPage interface and extends HttpServlet A servlet generated from a jsp is not an HttpServlet!

Don Bosco

Ranch Hand

Posts: 108

posted 13 years ago

HttpJspPage-->JspPage-->Servlet None of the above interfaces has the getServletContext() method. I see some jsp examples in hanumanth deshmukh book which use getServletContext() method directly. <% getServletContext.log("message"); %> How is this possible? Am I missing something?

I think the right bible should be Servlet 2.3 API, in which we find the the following: HttpJspPage -> JspPage -> Servlet. In HttpJspPage, service() method calls _jspService(). In HttpMethod, service() method calls the protected service() method which in turn calls one of the method among doGet, doPost... So a servlet generated from a Jsp is a servlet but not an HttpServlet.