response.setContentType("text/html,charset=gb2312");
解决方案 »
- strust2+spring为什么action中的值没有初始化?
- jquery问题
- servlet配置(网站前后台)
- 在jsp页面上输出mysql数据库中的文章没有格式怎么办
- 一个Spring的配置问题
- hibernate sql 问题
- 当tomcat 5.5.20遇上j2ee 6
- 请教有关JBoss的问题!
- 关于测试的问题!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
- (100:来者有分)假如你是SUN,现在开发petstore,从设计到运行,你会怎样什么样的步骤?
- 怎么灵活配置页面元素(文本框,checkbox等)
- axis 传递 JAVABean问题
string xx=new string(aa.getBytes("iso8859-1"),"GBK");
加到 jsp 页面应该就ok啦
看看你的页面有没有这句话.
不过建议最好的乱码处理方式就是写一个Filter.
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>page</title>
<script type="text/javascript" language="javascript" src="js/checkaddnew.js"></script>
</head>
<body>
<div class="addnews">
<form action="addnewsServlet?types=add" method="POST" name="form1">
<table border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td colspan="2" align="center">添加新闻</td>
</tr>
<tr><td></td></tr>
<tr>
<td align="center">新闻标题:</td>
<td> <input type="text" name="newstitle" size=30></td>
</tr>
<tr>
<td align="center">新闻内容:</td>
<td> <textarea cols="50" rows="4" name="newscontent"></textarea></td>
</tr>
<tr>
<td align="center" colspan="2"><a href="#" onclick="addnews()">确 定</a>
<a href="#" onclick="addnewsreset()">重 置</a> <a href="../index.jsp">返回首页</a></td>
</tr>
</table>
</form>
</div>
</body>
</html>呐!就这个要转到的页面!格式都设置了的啊!可是转到的时候还是乱码!请问是什么原因啊?
只用一个 不要2个都用