jsp - Check if a variable is already defined in java -


i need check if variable defined somewhere else in code when getting there.

because of includes in jsp, variable defined in 2 spots, , java returns error. using jsp:include doesn't seem work either.

i looking in form of #ifndef of c, not in pre-processor (as java) avoid having duplicate local variable issue.

i cannot use ==null or isnull() sometimes, variable won't defined @ all, not uninitialized

i don't believe there magic trick solve issue, thing done apply naming convention in jsp files meant included. can example add prefix name of variables, assuming file myfolder/foo.jsp , variable bar, can rename myfolder_foo_jsp_bar way won't have naming collision anymore.


Comments