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

  • 问题描述:

在a.jsp通过<%@ include file="b.jsp" %> 的方式引入b.jsp,但是报了标题的中的错误,

  • 问题原因:

在a.jsp的头部:

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

在b.jsp的头部:

             <%@ page language="java" contentType="text/html; charset=UTF-8"    pageEncoding="UTF-8"%>          发现a.jsp是小写的uft-8,而b.jsp是大写的UTF-8;
  • 解决方法:
          保持两者的头部一致:copy覆盖
时间: 2024-10-05 23:59:05

illegal to have multiple occurrences of contentType with different values (old: text/html; charset=UTF-8, new: text/html; charset=utf-8)的相关文章

/WEB-INF/pages/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=ut

这是jsp错误,不允许contentType="text/html; charset=UTF-8",有空格. 之前错误写法为:<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> 正确写法为:<%@ page language="java" contentType=&qu

illegal to have multiple occurrences of contentTyp

jsp1的第一行: <%@ page language="java" contentType="text/html;charset=UTF-8" pageEncoding="UTF-8" isELIgnored="false"%> jsp2的第一行 <%@ page language="java" contentType="text/html; charset=utf-8&quo

Page directive must not have multiple occurrences of pageencoding

一个jsp文件中不能同时出现两个 p.p1 { margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Monaco; color: #932192 } pageEncoding 关键词 例如以下的都是错误的: <%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1" pageEncoding="GBK&quo

报错:org.apache.jasper.JasperException: /jsp/head.jsp (line: 1, column: 2) Page directive: illegal to

上面报错提示的是org.apache.jasper.JasperException: /jsp/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)即:在/ jsp /head.jsp中(

JSP的静态包含和动态包含详细讲解 (一)

JSP包含有两种方式:静态包含和动态包含.下面我们将通过JSP运行的特点(转换为servlet再执行)来比较二者的区别. 一.静态包含  <%@include file="url"%> 我们先写一个正常的小项目,来看下静态包含是如何运行的. 测试一: top.jsp页面: <%@ page language="java" contentType="text/html; charset=UTF-8"     pageEncodin

javaweb报错总结

1. org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlMapClient' defined in class path resource [dao/spring-config-dao.xml]: Invocation of init method failed; nested exception is java.io.FileNotFoundException:

jsp中include的两种用法

JSP中的include的两种用法 1.两种用法 <%@ include file=” ”%> <jsp:include page=” ” flush=”true”/> 2.用法区别 (1)执行时间上区别 <%@ include file=”relativeURI”%>                   是在翻译阶段执行 <jsp:include page=”relativeURI” flush=”true” />  在请求处理阶段执行. (2)引入内容的

JSP中动态INCLUDE与静态INCLUDE的区别

动态INCLUDE用jsp:include动作实现 <jsp:include page="included.jsp" flush="true" />它总是会检查所含文件中的变化,适合用于包含动态页面,并且可以带参数. 静态INCLUDE用include伪码实现,定不会检查所含文件的变化,适用于包含静态页面<%@ include file="included.htm" %> 下面非常详细地解析了有关JSP动态INCLUDE和

select标签multiple属性的使用方法

前些日子公司让做一个功能模块,对于里面一个小功能费了些周折,现将其总结一下: 一.实现效果: 一.实现代码: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml&qu