Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JSP Base class

 
Joe Harry
Ranch Hand
Posts: 10128
3
Eclipse IDE Mac PPC Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is it true that in the HttpJspBase abstract class the methods init() service() and destry() are marked final and that it is from these respective methods, the corresponding jspInit() _jspService() and jspDestroy() are called??
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think that HttpJspBase is an Apache implementation, so you should not have to care about what it does. You can check the API on the net, for example :
http://www.jdocs.com/jasper/5.0.27/api/org/apache/jasper/runtime/HttpJspBase.html#init(javax.servlet.ServletConfig)
 
Joe Harry
Ranch Hand
Posts: 10128
3
Eclipse IDE Mac PPC Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I asked this because there was a question like what prevents us from overriding init(), service() and destroy(). So the reason that I found out was, they are declared final. Not only this but I guess it should be the standard for a web container. Am I right Satou??
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So the reason that I found out was, they are declared final. Not only this but I guess it should be the standard for a web container

The container provider decided to make them final because you should not implement them. As I explained in a previous thread, those are crucial servlets life cycle methods, which you should not deal with in JSP files. The same methods, called jspXXX were made for this purpose.
So the way of thinking is not "methods are final so I can't override", but "I will use jspInit, _jspService and jspDestroy because that's the only thing I have".
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic