Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

local variables in jsp?  RSS feed

 
umar hathab
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
when we declare local variables inside the scriptlet of jsp ,that are put inside service method.what would happen if u declare lot of local variables and how it would affecf the performance and whats the remedy?
thanks,
A.Umar
 
Frank Carver
Sheriff
Posts: 6920
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't suppose it would affect performance much, unless these local variables have big, slow, constructors which are called every time. Just declaring a few tens of ints, Strings or whatever should make no perceptible difference.
Can you tell us more about what you want to do? Have you tried it and hit some performance problems ?
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
See also http://www.coderanch.com/t/391955/java/java/variables-declaration
 
Elizabeth Reynolds
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Interesting question umar. Are you trying to avoid a concurrency problem? Can anyone answer from this perspective?
[ July 06, 2002: Message edited by: Elizabeth Reynolds ]
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Elizabeth, generally there aren't any concurency problems when using local variables. Do you have any specific doubts?
 
Elizabeth Reynolds
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No doubts whatsoever. Sorry, I guess it wasn't as interesting a question as I thought.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!