wood burning stoves 2.0*
The moose likes JSP and the fly likes include duplicate issue Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "include duplicate issue" Watch "include duplicate issue" New topic
Author

include duplicate issue

Mike Spenser
Greenhorn

Joined: Jun 13, 2006
Posts: 21
General question about how <@include ... %> and <jsp:include ... /> work.

if say for example I had a header defined as

<html><body><h1>TEXT</h1></body></html>

and then in my main page
<html><body>

[@inclue or jsp:include]

<p>some body text here</p>

</body></html>

won't that duplicate the html? since, in the case of @include its akin to a C MACRO or a straight up copy-and-paste?

is the correct way to do this to strip the offending tags (the HTML and BODY in my example) or does jsp:include do some magic to strip out the unwanted ones?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60774
    
  65

Why are they there in the first place? Why does the header have html tags and the body too? It's your reponsibility to make sure that the HTML is well formed.

And no, there is no magic to the include mechanism. To all JSP mechanisms HTML is just template text with no semantics applied.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Mike Spenser
Greenhorn

Joined: Jun 13, 2006
Posts: 21
thanks, makes sense
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60774
    
  65

Perhaps this article might be of interest.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: include duplicate issue
 
Similar Threads
how to use ssi in servlets using apache web server and jserv
jsp:include
Problem with SHTML
When jsp:include and include directive are different?
Dynamically assign an included bean property