Solved

Is there a destructer or final method called in jsp beans (non-ejb)?

Posted on 2002-07-24
8
240 Views
Last Modified: 2010-04-01
Hello,

I have a jdbc bean (non-ejb) called by a jsp. I want the jdbc statements closed when the bean is no longer needed.

Is there a final, or destructer method that is called automatically?

thanks,

Keith
 
0
Comment
Question by:keithedward
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
8 Comments
 
LVL 19

Expert Comment

by:cheekycj
ID: 7175200
servlets have a destroy() method where you can do your cleanup (just like the init() method for initialization)

CJ
0
 
LVL 19

Expert Comment

by:cheekycj
ID: 7175205
for JSPs this method is sometimes called jspDestroy()
0
 

Author Comment

by:keithedward
ID: 7175411
yes.... but what about the bean method for destory?

0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:keithedward
ID: 7175464
do I just put a destroy() method in the bean, and when the bean is no longer needed, the destory method is run?

0
 
LVL 19

Accepted Solution

by:
cheekycj earned 50 total points
ID: 7175489
I thought you were talking about a jsp not a bean.

For standard java classes (beans) you should implement a finalize() method.  It is very weakly enforced (not like C's destructor) but you can call it explicitly.

CJ
0
 
LVL 19

Expert Comment

by:Kuldeepchaturvedi
ID: 9561101
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

"To be PAQd/no refunds."
 
Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

Kuldeepchaturvedi
EE Cleanup Volunteer
0
 
LVL 19

Expert Comment

by:cheekycj
ID: 9562083
I thought I answered the question with my last comment.

CJ
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
getting Http 404 error in jsp forms 8 89
maven project in eclipse 11 62
HTML5 vs JSP - REST based application development 4 1,442
java operators 3 127
Auditing domain password hashes is a commonly overlooked but critical requirement to ensuring secure passwords practices are followed. Methods exist to extract hashes directly for a live domain however this article describes a process to extract u…
A big percent of today’s marketing activity is performed through the online environment. The marketing strategies that have existed a decade ago no longer relate to what’s happening today. We’re currently facing a revolutionary era, called the digit…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question