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
Solved

Nullify objects in JSP

Posted on 2006-06-22
1
372 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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

Most MSPs worth their salt are already offering cybersecurity to their customers. But cybersecurity as a service is wide encompassing and can mean many things.  So where are MSPs falling in this spectrum?
Starting your own business is always a daunting process, and for most people it is brand new experience. Avoid the common pitfalls by following these tips to start on the road to success.
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

808 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