Win a copy of Learning Regular Expressions this week in the General Computing 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:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

calling sub class' method from super class  RSS feed

 
Ranch Hand
Posts: 3830
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

This line is with reference to page 294 of HFS&J.

"Builds the service() method. This service method's actual name is _jspService(). It's called by the servlet superclass' overridden service() method....."

So in case of tomcat, the super class of this servlet (which was JSP before) is HttpJspBase. This HttpJspBase is also servlet (extends HttpServlet) and has overriding service() method. Now this overriding service() method calls our _jspService() method...

I am confused, how can we call sub class' method from super class without even knowing the name of sub class???

Hope my question is clear.
Thanks.

[ May 16, 2006: Message edited by: rathi ji ]
 
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Because HttpJspBase defines the _jspService method as abstract.

for example:


The container is going to instanciate your jsp with something like:
HttpJspBase servlet = new MyJspFile();

I hope this is clear enough.
 
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It says:

from the superclass' overridden service() method

 
ankur rathi
Ranch Hand
Posts: 3830
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Ben and Satou.
I got the point Ben.

[ May 16, 2006: Message edited by: rathi ji ]
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!