Solved

Nullify objects in JSP

Posted on 2006-06-22
1
366 Views
Last Modified: 2008-03-06
Should I nullify Object references in JSP's.
All my JSP pages uses a lots of String variables, should I nullify each one of them in the end of the page or are the objects automatically destroyed after the JSP page is executed.

Thanks
0
Comment
Question by:thomas908
1 Comment
 
LVL 3

Accepted Solution

by:
runa_paathak earned 125 total points
ID: 16958614
The Java code that you write in your JSP goes into the the service() method of the generated servlet. If you declare variables within <%%> block, they become local variables of service() method. So when the service() method completes (i.e., "jsp page is executed"), all local variables (i.e., local to service() ) will be destroyed.

If you declare variables in <%! %> block, they become instance variables of the generated servlet, so they will not be destroyed when the service() method completes execution.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Microsoft Office Picture Manager was included in Office 2003, 2007, and 2010, but not in Office 2013. Users had hopes that it would be in Office 2016/Office 365, but it is not. Fortunately, the same zero-cost technique that works to install it with …
This article lists the top 5 free OST to PST Converter Tools. These tools save a lot of time for users when they want to convert OST to PST after their exchange server is no longer available or some other critical issue with exchange server or impor…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.

910 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now