jsp中文显示问号问题解决方法
2015-02-03来源:易贤网

jsp中想要输出的中文被显示成问号?在eclipse-windows- preferences中搜索jsp,encoding选项中选择 chinese,此问题便可解决

问题: jsp中想要输出的中文被显示成“?”

解决方法 : 在eclipse-windows- preferences中 搜索jsp , encoding选项中选择 chinese 。 这样新建的jsp文件将支持中文显示。

对已经存在的jsp文件做如下修改: 将各种编码方式都改成gb18030,如下:

代码如下:

<%@ page language=java contenttype=text/html; charset=gb18030

pageencoding=gb18030%>

<!doctype html public -//w3c//dtd html 4.01 transitional//en >

<html>

<head>

<meta http-equiv=content-type content=text/html; charset=gb18030>

<title>hello</title>

</head>

<body>

你好

</body>

</html>

则“你好”可正确显示

更多信息请查看IT技术专栏

推荐信息