jsp页面出现异常

2022-11-13 11:02:26 浏览数 (1)

仔细阅读错误信息: Page directive: illegal to have multiple occurrences of contentType with different values (old: text/html; charset=utf-8,new: text/html;charset=utf-8) 原来是包含页面与被包含页面的@page指令里面的contentType不一致,仔细检查两个文件第一行的 @page,

 当一个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写成一致,一定要一致

0 人点赞