Solved

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

Posted on 2002-07-24
8
239 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
  • 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
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 

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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
java cigar challenge 58 214
How to set default webapp for host 6 47
mask rule in struts validation.xml 5 96
ejb on wildfly 5 30
With User Account Control (UAC) enabled in Windows 7, one needs to open an elevated Command Prompt in order to run scripts under administrative privileges. Although the elevated Command Prompt accomplishes the task, the question How to run as script…
In threads here at EE, each comment has a unique Identifier (ID). It is easy to get the full path for an ID via the right-click context menu. However, we often want to post a short link within a thread rather than the full link. This article shows a…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

830 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