Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Including xhtml (html) into another xhtml file

 
Kevin P Smith
Ranch Hand
Posts: 362
  • Mark post as helpful
  • send pies
  • 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.
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64629
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moved to a more appropriate forum.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic