Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JSP FAQ

 
KumarLalit Gupta
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can i use finalize() method instead of jspDestroy()
 
Carl Trusiak
Sheriff
Posts: 3341
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, you can always use finalize as it's a public method in Object and since a method cannot be overwritten to have a stricter access modifier, you can always use it.

The real Question is: Do you want to? That answer is NO. This is because you could inadvertantly prevent the execution of other code provided by the container necessary for proper cleanup of the JSPs Super Classes and wind up with a lot of unnecessary Objects in your container everytime a JSP is redeployed. A good rule of Thumb is to only use the Super Class methods in JSPs (And most APIs) that the documentation tells you to.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic