aspose file tools*
The moose likes JSP and the fly likes about jsp:include causing duplicated tags like head,meta Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "about jsp:include causing duplicated tags like head,meta" Watch "about jsp:include causing duplicated tags like head,meta" New topic
Author

about jsp:include causing duplicated tags like head,meta

Tianpeng Xia
Greenhorn

Joined: Feb 07, 2012
Posts: 16
hi , everyone.
Just got stuck here. when i use jsp:include to include header.jsp and footer.jsp into my index page, in firefox's source view, i notice the body,head, meta tags are duplicated for 3 times.

Can I just remove the duplicated ones and only keep the head tags<html> and<body> in the header.jsp, and keep </html>and </body> tags in the footer.jsp?
THANKS!
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 30753
    
156

Edit the files to remove the extra tags. Seriously, those tags were created (presumably by an IDE using a wizard) when creating those JSPs. jsp:include is including literal text. It isn't adding extra tags.

Which is good. Because you only have to remove the tags once and you are done.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Tianpeng Xia
Greenhorn

Joined: Feb 07, 2012
Posts: 16
thanks! Jeanne
Sumit Patil
Ranch Hand

Joined: May 25, 2009
Posts: 296

This time it was Jeanne and not Bear, answering the question :)
Edit :- Oops...you changed the name... thanks


Thanks & Regards, Sumeet
SCJP 1.4, SCWCD 5, LinkedIn Profile
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: about jsp:include causing duplicated tags like head,meta