Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

problems with include directive

 
mocca az
Ranch Hand
Posts: 93
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Greetings!
I have the following question. I would like to know how to pass a varable to a include directive.
<%@ include file=<%= myfile %> %>
This won't work. Compiler is complaining about the missing quotes
<%@ include file="<%= myfile %>" %>
This won't work because Tomcat is looking for this file name <%= myfile %> which doesn't exist.
What i am trying to do is to load diferent files into a table cell without reloading the entire page.
Greatly appreciated
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you need to use the XML style include:
<jsp:include page="<%=myFile%>" flush="true" />
I recommend you check out the JSP syntax sheet available from the Sun site.
Um... http://java.sun.com/products/jsp off the top of my head. Wouldn't trust it too much.
Dave.
 
mocca az
Ranch Hand
Posts: 93
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you David, that was exactly what i was looking foor.
It works great.
M, phx
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic