myeclipse8.6+tomcat6.0中文乱码问题,和数据库无关。

kindtoadsd 2011-03-18 11:34:40
JSP设置:

<%@ page contentType="text/html;charset=utf-8" language="java" import="java.util.*" pageEncoding="GBK"%>
<html>
<head>

<META http-equiv=Content-Type content="text/html;charset=utf-8" >

<LINK href="images/css.css" type=text/css rel=stylesheet>

</head>



ACTION中
protected void doGet(HttpServletRequest request,
HttpServletResponse response)

throws ServletException, IOException {

request.setCharacterEncoding("GBK");
String action = request.getParameter("action");
String name = request.getParameter("name");
String id = request.getParameter("id");
这里的name已经是乱的了。

myeclipse的properties中是GBK
请给出正确的设置方法。我现在出来的中文是乱码。谢谢,相信很多人是过来人了。
...全文
151 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
star95hmz 2011-03-18
  • 打赏
  • 举报
回复
统一编码方式,都设置为utf-8试试
福来哥 2011-03-18
  • 打赏
  • 举报
回复
http://blog.csdn.net/feg545/archive/2011/02/22/6200710.aspx
幽饮烛 2011-03-18
  • 打赏
  • 举报
回复
<%@ page contentType="text/html;charset=utf-8" language="java" import="java.util.*" pageEncoding="GBK"%>
<META http-equiv=Content-Type content="text/html;charset=utf-8" >
request.setCharacterEncoding("GBK");

编码不统一
kindtoadsd 2011-03-18
  • 打赏
  • 举报
回复
不行,试过了

58,454

社区成员

发帖
与我相关
我的任务
社区描述
Java Eclipse
社区管理员
  • Eclipse
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧