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

Using variables in the include directive  RSS feed

 
Richard Elsberry
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
I have quite a few jsp pages that I would like to imbed in a master jsp page. The jsp that is imbedded would be determined by an sql query. The problem is that I don't know how to use a variable in the include directive's page attribute.
I've been able to make this work using the include action but the problem is that the included page needs to be able to access a hashtable in the parent. This doesn't work in the action include.
Does anybody know how to do something like:
<%@ include file="<%= myFile %>"%> or another approach that I might be overlooking?
Thanks, Richard
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You have to use the JSP (XML-style) tags. THis is a quote from the JSP Syntax sheet

Note that this means you can do ...page="<%=pageName%>"... but may not be able to do ...page="/images/<%=pageName%>"... depending on the server you are using.
Dave.
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!