0

I have two jsps , where main.jsp includes sub.jsp

The content type of main.jsp is set as <%@ page contentType="text/html;charset=UTF-8" language="java"%>

Where as that of the sub.jsp as <%@ page contentType="text/html; charset=UTF-8" language="java" %>

(Note the space in content type)

The main.jsp includes sub.jsp using the below include tag

 <%@ include file="/jsp/sub.jsp" %>

On including a file repeating the content type has no effect! But still on compilation

llegal to have multiple occurrences of contentType with different values (old: text/html;charset=UTF-8, new: text/html; charset=UTF-8)

Confused ! Does a "space" makes it a different content type? What happens with content type during compilation? Is it taken as two different content types ? Why do I get this exception!

  • i think you should not have two content type in one jsp. remove content type and charset from sub.jsp. it should work. – soorapadman Oct 19 '15 at 08:35
  • check this link:http://stackoverflow.com/questions/24743585/error-illegal-to-have-multiple-occurrences-of-contenttype-with-different-val – soorapadman Oct 19 '15 at 08:44
  • Does Repeating the content type in a included jsp has any effect ?check here http://stackoverflow.com/questions/2898991/java-jsp-repeating-the-contenttype-header-in-a-sub-jsp it says no effect! – Jeyshri Gopalakrishnan Oct 19 '15 at 09:36

0 Answers0