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

Elementary Jsp Include Question  RSS feed

 
Chris Reeves
Ranch Hand
Posts: 95
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I need to include html files, which act as templates, that exist outside my webapp. There will be hundreds of these files, and the jsp decides at run-time which file to include. I have the files stored at /var/templates/, but I can't seem to include them.
The message I get back, in this case from Orion, is that the file could not be found. The path that the error returns is always prepended by "/".
Is it not possible to include files that do not exist within the webapp?
My efforts to include urls from another host don't work as well. Perhaps I've made too many assumptions here...
 
Anthony Villanueva
Ranch Hand
Posts: 1055
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The file attribute will read its value relative to the JSP's application context. See the include directive.
 
Chris Reeves
Ranch Hand
Posts: 95
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, that would explain it.
Any suggestions on including files that are outside the context, short of writing explicit I/O calls?
 
Louise Haydu
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why don't you want the HTML files to reside in the web app? You could put them in their own directory.
 
Chris Reeves
Ranch Hand
Posts: 95
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's really a deployment issue. I have to render multiple sites, all with the same function but with different templates. Rather than incorporating the templates into the web app (I have an external tool that will manage the look and feel and will create the html pages offline), I want to keep them isolated, and pull them in dynamically.
I will have, potentially, hundreds of other sites. So, I don't want to put them in my webapp - which is actually just part of a larger enterprise app.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!