中文乱码问题
<%@page contentType="text/html" import="data.DBClass,java.sql.ResultSet"%><%@page pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title></title>
</head>
<body>
<%
request.setCharacterEncoding("gb2312");
String act="";
if(request.getParameter("act")!=null){
act=request.getParameter("act").trim();
//插入
if(act.equals("insert")){
String action=request.getParameter("act");
String sid=request.getParameter("sid");
String stitle=request.getParameter("stitle");
String mid=request.getParameter("mid");
String stype=request.getParameter("stype");
DBClass db=new DBClass();
int flag=db.update("insert into by_subdir (s_id,s_title,m_id,s_type) values('"+sid+"','"+stitle+"','"+mid+"','"+stype+"')");
if(flag>0){
response.sendRedirect("manager.jsp?g_id=3");
}
}
%>
</body>
</html>