1. 程式人生 > >JSP頁面報錯illegal to have multiple occurrences of contentType with different values

JSP頁面報錯illegal to have multiple occurrences of contentType with different values

當一個jsp頁面包含另外一個jsp頁面或者HTML頁面時,如果出現了亂碼,或者是出現了“org.apache.jasper.JasperException: /stuHead.html(2,0) Page directive: illegal to have multiple occurrences of contentType with different values (old: text/html;charset=gb2312, new: text/html; charset=gb2312)”,這樣的錯誤,就應該把把包含頁面與被包含頁面的@page指令裡面的contentType寫成一致,一定要一致,我曾經嘗試著在一個裡面加上一個空格也出現了這樣的錯誤。