Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Nullify objects in JSP

Posted on 2006-06-22
1
Medium Priority
?
382 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
[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
1 Comment
 
LVL 3

Accepted Solution

by:
runa_paathak earned 500 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Working from home is a dream for many people who aren’t happy about getting up early, going to the office, and spending long hours at work. There are lots of benefits of remote work for employees.
With so many activities to perform, Exchange administrators are always busy in organizations. If everything, including Exchange Servers, Outlook clients, and Office 365 accounts work without any issues, they can sit and relax. But unfortunately, it…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …

610 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