现在的位置: 首页 > 综合 > 正文

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

2013年10月21日 ⁄ 综合 ⁄ 共 372字 ⁄ 字号 评论关闭

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

1
2
3
4
5
6
7

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格式

【上篇】
【下篇】

抱歉!评论已关闭.