Java (JSP): repeating the contentType header in a "sub-jsp"

Posted by Webinator on Stack Overflow See other posts from Stack Overflow or by Webinator
Published on 2010-05-24T17:42:15Z Indexed on 2010/05/24 17:51 UTC
Read the original article Hit count: 926

Filed under:
|
|

What happens when headers are repeated in a .jsp you include in another .jsp?

For example if example.jsp starts with this:

<?xml version="1.0" encoding="UTF-8"?>
<jsp:root version="2.0" xmlns:jsp="http://java.sun.com/JSP/Page">
<jsp:directive.page contentType="text/html; charset=UTF-8" />

<div class="content">

<jsp:include page="support-header.jsp"/>
...

(it includes support-header.jsp)

And then support-header.jsp starts also with this:

<?xml version="1.0" encoding="UTF-8"?>
<jsp:root version="2.0" xmlns:jsp="http://java.sun.com/JSP/Page">
<jsp:directive.page contentType="text/html; charset=UTF-8" />
... 

Is that a problem? Is it bad practice?

What does concretely happen when you repeat several times a header that only corresponds to one header in the resulting .html page?

© Stack Overflow or respective owner

Related posts about java

Related posts about jsp