博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
解决Page directive: illegal to have multiple occurrences of contentType with different values错误
阅读量:4027 次
发布时间:2019-05-24

本文共 1541 字,大约阅读时间需要 5 分钟。

一个jsp页面包含另一个jsp页面忽然出现这种错误

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

    at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:41)
    at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:275)
    at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:107)
    at org.apache.jasper.compiler.Validator$DirectiveVisitor.visit(Validator.java:135)
    at org.apache.jasper.compiler.Node$PageDirective.accept(Node.java:571)
    at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2376)
    at org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2428)
    at org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2434)
    at org.apache.jasper.compiler.Node$Root.accept(Node.java:464)
    at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2376)
    at org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2428)
    at org.apache.jasper.compiler.Validator$DirectiveVisitor.visit(Validator.java:101)
    at org.apache.jasper.compiler.Node$IncludeDirective.accept(Node.java:635)
    at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2376)
    at org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2428)
    at org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2434)
    at org.apache.jasper.compiler.Node$Root.accept(Node.java:464)

 

首先看下此两个页面中page指令

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

charset=UTF-8 字符集是否不同。大小写不同也会报错。所以保持统一。两个页面的字符集设置成一模一样。要么同时大写要么同时小写

转载地址:http://hlvbi.baihongyu.com/

你可能感兴趣的文章
[LeetCode By Python]107. Binary Tree Level Order Traversal II
查看>>
[LeetCode By Python]108. Convert Sorted Array to Binary Search Tree
查看>>
[leetCode By Python]111. Minimum Depth of Binary Tree
查看>>
[LeetCode By Python]118. Pascal's Triangle
查看>>
[LeetCode By Python]121. Best Time to Buy and Sell Stock
查看>>
[LeetCode By Python]122. Best Time to Buy and Sell Stock II
查看>>
[LeetCode By Python]125. Valid Palindrome
查看>>
[LeetCode By Python]136. Single Number
查看>>
[LeetCode By Python]167. Two Sum II - Input array is sorted
查看>>
[LeetCode BY Python]169. Majority Element
查看>>
[LeetCode By Python]172. Factorial Trailing Zeroes
查看>>
[LeetCode By MYSQL] Combine Two Tables
查看>>
python jieba分词模块的基本用法
查看>>
[CCF BY C++]2017.12 最小差值
查看>>
[CCF BY C++]2017-12 游戏
查看>>
如何打开ipynb文件
查看>>
[Leetcode BY python ]190. Reverse Bits
查看>>
面试---刷牛客算法题
查看>>
Android下调用收发短信邮件等(转载)
查看>>
Android中电池信息(Battery information)的取得
查看>>