Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

why HttpJspPage extends both JspPage and Servlet interfaces?

 
Sai Prasad
Ranch Hand
Posts: 560
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
All,
Can you help me understand why javax.servlet.jsp.HttpJspPage interface extends both javax.servlet.Servlet and javax.servlet.jsp.JspPage interfaces? If you notice, JspPage also extends the Servlet interface. Thanks.
 
jr gil
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Perhaps it just builds on some of the basic functionality tied into the
init()
service()
destroy()
lifecycle methods built into the servlet interface. Servlet also provides the getServletConfig() which can be used in cases where you want to access init-param from the web.xml file inside the jsp.
JspPage adds the jspInit() and the jspDestroy() methods which are invoked by the container for the lifecycle methods instead of the servlet init() and destroy() but my guess is that it still uses some of the "behind the scenes" functionality used by the original methods.
Just A Thought...
 
Sai Prasad
Ranch Hand
Posts: 560
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is no implementation happening behind the scene. Servlet, JspPage and HttpJspPage are all interfaces. May be, JspPage was not a Servlet during the initial release and then got retrofitted as a Servlet. This is my best guess.
 
Mark Howard
Ranch Hand
Posts: 285
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Sai Prasad:
Can you help me understand why javax.servlet.jsp.HttpJspPage interface extends both javax.servlet.Servlet and javax.servlet.jsp.JspPage interfaces? If you notice, JspPage also extends the Servlet interface. Thanks.

Hi Prasad
HttpJspPage extends from JspPage, and JspPage extends from Servlet. Hence HttpJspPage, by OO definition, extends both JspPage and Servlet.
I'm not sure I understand your confusion?
Mark
 
Sai Prasad
Ranch Hand
Posts: 560
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Mark,
You are right. I wasn't looking properly. Thanks.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic