不能显示中文怎么半?
下面是jsp文件:
<%@ page language="java" contentType="text/html; charset=gb2312"
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>include实验</title>
</head>
<body>
<%@ include file="123" %>
</body>
</html>
下面是html文件:
<HTML>
<HEAD>
<TITLE>Html File</TITLE>
</HEAD>
<BODY>
这是加载的 html 文件
</BODY>
</HTML>
_________________
在调用时html文件里的中文不显示出来,而是"?????????? html ???? ".
高手留言啊!!!!
搜索更多相关主题的帖子:
中文
----------------解决方案--------------------------------------------------------
<%@ page language="java" contentType="text/html; charset=gb2312" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>include实验</title>
就是这里的问题.
----------------解决方案--------------------------------------------------------
可是我把"<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">"删了,或者把 charset=ISO-8859-1改成gb2312都还是不行...是怎么回事啊??
----------------解决方案--------------------------------------------------------
charset=ISO-8859-1"去掉
<%@ include file="123" %>
该成<jsp:include>标签试试
----------------解决方案--------------------------------------------------------
我也搞不懂了:
为什么用<jsp:include page="123" />可以正确显示中文;
而用<%@ include file="123" %>则不能显示;
这是不是和它们的工作原理有关呢;
它们两者的工作原理各是怎么样的呢...
----------------解决方案--------------------------------------------------------
顶5楼的问题!!请高手继续解答!!!!
----------------解决方案--------------------------------------------------------
添加一个过滤器<filter>
----------------解决方案--------------------------------------------------------
http://bbs.chinajavaworld.com/message.jspa?messageID=646521
大家参考一下就知道了这是Tomcat的原因;
但是同时
<jsp:include page="123"/>和<%@ include file="123"%>
也是有区别的,以下是他们各自编译成Servlet文件后的语句:
<%@ include file="123"%>
对应的是:out.write("ÕâÊǼÓÔØµÄ102 html Îļþ\r\n");
<jsp:include page="123"/>
对应的是:org.apache.jasper.runtime.JspRuntimeLibrary.include(request, response, "123", out, false);
PS:提醒lz包含文件中最好不要含有<html></html><body></body>
[此贴子已经被作者于2007-11-8 22:50:16编辑过]
----------------解决方案--------------------------------------------------------
楼上的例子不错
----------------解决方案--------------------------------------------------------
<jsp:include page="123" />
<%@ include file="123" %>
两者的编译方式不一样 一个是单独编译再与其他页面整合 一个是先包起来再一起编译
我想是不是这个原因呢
----------------解决方案--------------------------------------------------------