Solved

Nullify objects in JSP

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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Stuck in Bootstrap WysiHtml Editor 3 44
I am having a difficulty creating a responsive Page for my website. 10 87
gZip compression filter 2 183
jsp insert to database example 2 65
Read  the original post  on Monitis Blog. Hi.  My name is Erik Dietrich, and this is the first time I’ve posted on the Monitis blog.  By way of introduction, I thought it would make sense to talk about my initial experience with Monitis.   Befo…
Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

730 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