• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Bear Bibeault
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Ganesh Patekar
  • Frits Walraven
  • Tim Moores
  • Ron McLeod
  • Carey Brown
  • Stephan van Hulst
  • salvin francis
  • Tim Holloway

Include HTML files?  RSS feed

Ranch Hand
Posts: 178
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have some HTML code that needs to be used in a couple different files. I have thought about putting this HTML code into jspf (jsp fragment files) and including them into each HTML page. To do this, though, I'd need to convert all the HTML pages to JSP's. This seems excessive because the content is static, not dynamic, and therefore doesn't warrant JSP files. Furthermore, creating the context as JSP files requires that the pages be compiled which is not necessary. I'd like to know if there is a way to include HTML fragments into HTML files. If so, what code do I use to include the HTML fragments into the HTML files? How should the included HTML fragments look?
Thanks in advance.
Posts: 15385
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you can look at this,... http://www.coderanch.com/t/113810/HTML-JavaScript/including-html-doc-within-another

or you could do iframes and just include them on the page as html files.. all modern browsers support iframes...This was you would be able to include html documents, but it is a bit messy.
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!