contentType 'text/xml; charset=UTF-8' conflicts问题

Resin升级到3.1.3后,有同事发现原来在Resin 3.0.xx下成功运行的部分jsp文件(输出xml格式文件)编译出错:

1234567
500 Servlet Exception
XXXXX.jsp:1: contentType ‘text/xml; charset=UTF-8‘
conflicts with previous value of contentType ‘text/html; charset=UTF-8‘.
Check the .jsp and any included .jsp files for conflicts.
 
1:  <%@ page language="java" contentType="text/xml; charset=UTF-8" %>
2:  <%@ page

经反复测试,发现是文件格式问题。

解决方法:

解决方法:

用UltraEdit编辑JSP,另存为UTF-8 BOM格式 发现不报错,但是有乱码,存为ANSI/ASCII就没有乱码且不报错了。

contentType 'text/xml; charset=UTF-8' conflicts问题

时间: 2024-07-28 13:05:20

contentType 'text/xml; charset=UTF-8' conflicts问题的相关文章

解决&quot;415 Cannot process the message because the content type &#39;application/x-www-form-urlencoded&#39; was not the expected type &#39;text/xml; charset=utf-8&#39;&quot;

wcf basicHttpBinding content-type    text/xml;charset=utf-8 wsHttpBinding  'application/soap+xml; charset=utf-8' webHttpBinding 'application/x-www-form-urlencoded'   对应网页中的post请求 所以如果是post请求wcf服务,要使用webHttpBinding 解决"415 Cannot process the message be

PHP插入header(&#39;content-type:text/html;charset=&quot;utf-8&#39;)和error_reporting()

1.header PHP文件插入header("Content-type: text/html; charset=utf-8");相当于页面里面的<meta http-equiv="Content-Type" content="text/html; charset=utf-8">;目的:防止页面出现乱码 2.error_reporting 定义和用法:error_reporting()设置PHP的报错级别并返回当前级别.函数语法:er

PHP中header(&#39;content-type:text/html;charset=&quot;utf-8&#39;)和error_reporting()的作用

1.header PHP文件插入header("Content-type: text/html; charset=utf-8");相当于页面里面的<meta http-equiv="Content-Type" content="text/html; charset=utf-8">;目的:防止页面出现乱码 2.error_reporting 定义和用法:error_reporting()设置PHP的报错级别并返回当前级别.函数语法:er

未能加载文件或程序集“System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35”或它的某一个依赖项。响应消息的内容类型 text/html; charset=utf-8 与绑定(text/xml; charset=utf-8)的内容类型不匹配。

项目从一台服务器挪到另外一台服务器后,无法运行:(1)调用webservice的项目报错:[ProtocolException: 响应消息的内容类型 text/html; charset=utf-8 与绑定(text/xml; charset=utf-8)的内容类型不匹配.如果使用自定义编码器,请确保正确实现 IsContentTypeSupported 方法.响应的前 1024 个字节为:"<!DOCTYPE html>(2)webservice本身运行的报错:未能加载文件或程序集

&lt;%@page contentType=&quot;text/html;charset=gbk&quot;%&gt;与&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=GBK&quot;&gt;区别

前一个是在服务端起作用,是告诉应用服务器采用何种编码输出JSP文件流,后一个是在客户端起作用,是告诉浏览器是采用何种编码方式显示HTML页面. 前者由jsp引擎对输出内容进行编码, 后者将由IE对页面内容进行编码,他们负责的编码对象不同.所以,我们有些时候会出现页面上的一些东西是正常的,而out.print...出来的东西是乱码,就是这个原因.

jsp中pageEncoding、charset=UTF -8

jsp中pageEncoding.charset=UTF -8" 在JSP/Servlet  中主要有以下几个地方可以设置编码,pageEncoding="UTF-8".contentType="text/html;charset=UTF  -8".request.setCharacterEncoding("UTF-8")和response.setCharacterEncoding  ("UTF-8"),其中前两个只

Webservice报错客户端发现响应内容类型为“application/json;charset=UTF-8”,但应为“text/xml”。

控制台对接Webservice正常,同样的方法在Web项目上报错: 客户端发现响应内容类型为“application/json;charset=UTF-8”,但应为“text/xml”.请求失败,错误信息为:--{ "code" : "03010250002", "msg" : "Illegal json string", "data" : ""}--. 说明: 执行当前 Web 请求期

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=

/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