aspose file tools*
The moose likes Servlets and the fly likes problems with include directive Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "problems with include directive" Watch "problems with include directive" New topic
Author

problems with include directive

mocca az
Ranch Hand

Joined: Mar 07, 2001
Posts: 93
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

Joined: Mar 06, 2001
Posts: 13459

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

Joined: Mar 07, 2001
Posts: 93
Thank you David, that was exactly what i was looking foor.
It works great.
M, phx
 
jQuery in Action, 2nd edition
 
subject: problems with include directive