Solved

Nullify objects in JSP

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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
Use of TCL script on Cisco devices:  - create file and merge it with running configuration to apply configuration changes
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

759 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

23 Experts available now in Live!

Get 1:1 Help Now