File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

jsp:include in a for loop

 
prabhat gupta
Greenhorn
Posts: 26
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i am trying the following code :
<%
for(int i=0;i<filelist.length;i++){
%>
<jsp:include page="../com/prod/<%= filelist[i]%>" flush="true" />
<%
}
%>
Here i want to know that will the above code run successfully.
What I want the jsp to do is run through the array of file names and include them in the response page.
If this code cannot do the trick than i think the other alternative will be to get a BufferedReader read strings from the file and send those through out.println() method.the included files are static html files.
Give me your suggestions and code if possible, please,
IT'S URGENT.
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The support for dynamic includes is vendor specific (ie it can change from product to product and even between versions) but if you have a look at the JSP Technology Syntax, the valid syntax for a JSP include is

Why is this important? It menas that this should be valid, whereas your code is not... (doesn't promise it will work tho)


Dave
 
prabhat gupta
Greenhorn
Posts: 26
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Still the html page is not included in the response.ie i want the content of the included html page to be displayed in the response page.I just want to incorporate some html formatted text present in those pages in the response.The jsp is still not doing that but yet runs successfully.
should i shift to the other alternative ie of bufferedReader.I have tried code on it and it works fine.Will this slow down the server response.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic