the problem that I can't seem to solve at the moment is passing a variable to includes that are dynamically compiled at runtime. the main file is index.jsp the example include is 03.jsp (one in a series of about 50 includes, all identified by number and all having the same template as this one). the problem I'm having is at lines 97-120 in index.jsp. I'm testing to see if there are any more rows in the iteration because the last row is formatted differently than all the rows preceding it. so I assign a variable to that condition and then, I hoped, it would get passed on to the include. that is, I assumed that the include was in the same scope as the variable since they are in the same section of the loop. index.jsp:
Bryan, Since you are using pageContext.include() to include the other jsp, isHighlight will not be visible. Remember, a JSP runs as a servlet and your scriptlets become code in the service() method of that servlet. That means that pageContext.include() is simply a method call to eventually executes another servlet (the one for 03.jsp) isHighlight is a local variable visible only in the enclosing if {} block in the index jsp-servlet. What you will need to do is to put the isHighlight flag in one of the collections. Try using request.setAttribute() in index.jsp and then request.getAttribute() in the included jsp. Also, I noticed that you use StringBuffer a lot but the way you use it doesn't buy you anything over using a String. Another thing: isHighlight == "yes" is wrong. Always use equals() method to test for String equality. HTH, Junilu