aspose file tools*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes why HttpJspPage extends both JspPage and Servlet interfaces? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "why HttpJspPage extends both JspPage and Servlet interfaces?" Watch "why HttpJspPage extends both JspPage and Servlet interfaces?" New topic
Author

why HttpJspPage extends both JspPage and Servlet interfaces?

Sai Prasad
Ranch Hand

Joined: Feb 25, 2002
Posts: 560
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

Joined: Jan 14, 2003
Posts: 7
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

Joined: Feb 25, 2002
Posts: 560
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

Joined: Feb 14, 2001
Posts: 285
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

Joined: Feb 25, 2002
Posts: 560
Mark,
You are right. I wasn't looking properly. Thanks.
 
 
subject: why HttpJspPage extends both JspPage and Servlet interfaces?