JSP include HTML body overrides HTML BODY tag that is included?

I'm facing confusion with how JSP include tag works. What's happening is that the base page's body tag has id attribute of included JSP. **base.jsp** <%@page contentType="text/html" pageEncoding="UTF-8"%> JSP Page /* base jsp has no id for body */

Hello World!

**include.jsp** <%@page contentType="text/html" pageEncoding="UTF-8"%> JSP Page /* here included jsp has body with ID specified */

Hello include!

When I go to base.jsp page, the firebug finds only one body tag which is ok but indicates that the **HTML BODY tag has id attribute of "includeBody"** **outcome:** JSP Page /* why this body has id ??? */

Hello World!

JSP Page

Hello include!

The base.jsp has body without id specified and include.jsp has body with id. Looks like if I don't specify the id in the body of base.jsp, included jsp body id will be applied. Is this a bug? Or should I remove body from included.jsp (no that can be true). Or I could add id to the base.jsp body so it won't get replaced with included body.
Try "view source" instead of Firebug's inspect. I think you will find your second BODY tag that way.

以上就是JSP include HTML body overrides HTML BODY tag that is included?的详细内容,更多请关注web前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » HTML5 答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准