• Post Reply Bookmark Topic Watch Topic
  • New Topic

translated jsp  RSS feed

 
Don Bosco
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A servlet generated from jsp implements the HttpJspPage interface and extends HttpServlet.
PLease correct me if i'm wrong.
 
yi zhu
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Maha Annadurai
Ranch Hand
Posts: 87
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes. The container generated servlet of a jsp page is HttpServlet.
Here is the API documentation of Tomcat's implementation.
http://jakarta.apache.org/tomcat/tomcat-4.0-doc/jasper/docs/api/index.html
Regards,
Maha Anna
 
yi zhu
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!