• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

include duplicate issue

 
Mike Spenser
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 65123
91
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Mike Spenser
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks, makes sense
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65123
91
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Perhaps this article might be of interest.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic