Help coderanch get a
new server
by contributing to the fundraiser
  • 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Including xhtml (html) into another xhtml file

 
Ranch Hand
Posts: 362
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Simple question really, how do you include a html file into a xhtml file?

I have seen plenty of examples that say use this:



But when I try it I get nothing, the 'comment' is in the page source hut the content of the header.html page isn't displayed in the xhtml page.
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is your server set up to do SSI [Server Side Includes]? Most servers require it to have the extension shtml if it is enabled.

Eric
 
Kevin P Smith
Ranch Hand
Posts: 362
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm using Glassfish which supports SSI but I think I need some config in my web.xml, I found this on the Shing Wai Chan - Blog



Also I have to have 'virtual' path (<!--#include virtual="/pages/common/header.html"-->) else I get the "A non-virtual path can't be absolute" error

I've just added extensions for xhtml in the url-pattern and mime-mappin extensions
 
Kevin P Smith
Ranch Hand
Posts: 362
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Just found that I have already posted a query abotu this, so I'll just update it.

This is being used under a Glassfish v3 server...
Basically this has not et been resolved, I have the web.xml params as below and the xhtml include as shown, but I see nothing from my 'child' xhtml in my 'parent' xhtml page.





Really frustrating as all the example just implly that it will simply work, this clearly is not the case.

Cheers in advance
 
Sheriff
Posts: 67750
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Moved to a more appropriate forum.
 
What are you doing in my house? Get 'em tiny ad!
We need your help - Coderanch server fundraiser
https://coderanch.com/t/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic