• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

included files and variable shadowing

 
Duran Harris
Ranch Hand
Posts: 608
Eclipse IDE Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ,

say I had the following jsp(theInclude.jsp):




and another:main.jsp:



What will the output be??

 
Rob Spoor
Sheriff
Pie
Posts: 20750
68
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The output will be one. The include directive does the including during translation, and so the generated code will contain both the instance variable declaration from the included file and the local variable declaration from main.jsp. You then print out the value of the local value.
 
Duran Harris
Ranch Hand
Posts: 608
Eclipse IDE Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK thanks..I couldn't try it myself because I had some problems with my tomcat-users file..
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic