• Post Reply Bookmark Topic Watch Topic
  • New Topic

jsp include

 
Joyce Derzaph
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is something that should be simple but it just won't work for some reason. All I get is a blank page. This is the whole document. The page I'm
trying to include does exist. It just won't display it. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<html>
<head>
<title></title>
</head>
<body text="#00ff66" bgcolor="#330033">
<jsp:include page="header.html" flush="true" />

</body>
</html>

Also, except for the name of the page and the lack of any text, this identical to another page I have that does work.
Any ideas?

Joyce
 
Mark Stein
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
instead of just "header.html" use the entire path, relative to the root. So if the file is sitting in the root dir, use "/header.html".
 
Joyce Derzaph
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tried that. Didn't make a difference. Thanks anyway though.

Joyce
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65518
105
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you really getting a blank page? In other words nothing at all? Or is it just that your body tag is empty?
 
Ivan Jouikov
Ranch Hand
Posts: 269
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
does header.html happen to be a blank page?
 
Manjunatha Prasad
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Give the information of where is your page location means html and from which location you are executing your jsp.

And also tell what exactly the error message is showing......

Regards,
 
Sonny Gill
Ranch Hand
Posts: 1211
IntelliJ IDE Mac
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try to change the included page to be a JSP page instead of an html page.
If you need to keep it with html extension, try using the ' <%@ include ' directive instead.

You many need to dig into the JSP specs to find out the exact reason for this, but my guess is that it has something to do with the fact that, the jsp:include action inserts the dynamically generated response from the included page, i.e the included page is passed the JspWriter object for the current request, and it writes its response to it.

Hope that helps
Sonny
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!