• Post Reply Bookmark Topic Watch Topic
  • New Topic

JSP Query  RSS feed

 
felix thomas
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,

I would like to know which class is extended by a JSP page , i mean super class if we do not extend any on the JSp page.

And why are the methods in the servlet class declared final , any idea
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by felix thomas:
hi,

I would like to know which class is extended by a JSP page , i mean super class if we do not extend any on the JSp page.

JSPs get compiled into servlet code. What class it extends depends on what JSP compiler you're using. In Tomcat it's org.apache.jasper.runtime.HttpJspBase which you can tell by looking in TOMCAT_HOME/work.



And why are the methods in the servlet class declared final , any idea

A better question would be "why not". There are some performance gains from declaring methods final (small ones) and, by design, the generated class file will never be extended so it just makes sense.

Out of curiosity: If you didn't already look at the generated servlet code, how did you know what methods are declared final?
 
felix thomas
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,

I came to know of the final methods thru the servlet API , but was not sure of what the super class are .

Thanx for ur reply
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!