What are the scoping rules for variables in a jsp page with pages added to them using tags?
My understanding is that an included page is essentially copied verbatim into the page, which would lead me to assume that if I've declared a variable in a Parent JSP that it would be available in the child ones.
However Eclipse complains about this (understandably because I could feasibly include the pages in any page or use them as stand alone. And when I try to start the tomcat server it fails to start.
I basically want to get a couple of variables from the session in the parent page and use them in the child pages. This doesn't work.
So I've struck ont he idea of getting them from the session in each of the child pages, however I was wondering if I could give them all the same variable names, or if I'd have to pick different variable names for them in each page so they didn't clash.
Also what about imports if I import log4net in the parent jss do I also have to import it in the child ones?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…