JSP页面中出现了Page directive: illegal to have multiple occurrences of contentType with different values异常

页面具体是这样报错的

HTTP Status 500 - /inc/common_head.jsp (line: 1, column: 2) Page directive: illegal to have multiple occurrences of contentType with different values (old: text/html;charset=UTF-8, new: text/html; charset=UTF-8)

type Exception report

message /inc/common_head.jsp (line: 1, column: 2) Page directive: illegal to have multiple occurrences of contentType with different values (old: text/html;charset=UTF-8, new: text/html; charset=UTF-8)

description The server encountered an internal error that prevented it from fulfilling this request.

exception

org.apache.jasper.JasperException: /inc/common_head.jsp (line: 1, column: 2) Page directive: illegal to have multiple occurrences of contentType with different values (old: text/html;charset=UTF-8, new: text/html; charset=UTF-8)

 

页面代码没错,我口头翻译了一下illegal to have multiple occurrences of contentType with different values,是包含页面和被包含页面的contentType设置不一样

包含页面原来的page指令是这样的

<%@ page contentType="text/html;charset=UTF-8" language="java" %>

 

被包含页面原来的page指令是这样的

<%@ page contentType="text/html; charset=UTF-8"%>

 

我把被包含页面,也就是我异常中提示的/inc/common_head.jsp页面中的page指令重新改成了包含页面中的page指令,就解决了

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值