This week's giveaway is in the JDBC forum.
We're giving away four copies of Java Database Connections & Transactions (e-book only) and have Marco Behler on-line!
See this thread for details.
Win a copy of Java Database Connections & Transactions (e-book only) this week in the JDBC forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Knute Snortum
  • Paul Clapham
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Frits Walraven
Bartenders:
  • Ganesh Patekar
  • Tim Holloway
  • salvin francis

why HttpJspPage extends both JspPage and Servlet interfaces?  RSS feed

 
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.
 
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.
 
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.
 
He's dead Jim. Grab his tricorder. I'll get his wallet and this tiny ad:
how do I do my own kindle-like thing - without amazon
https://coderanch.com/t/711421/engineering/kindle-amazon
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!