乱码困扰,求救。 请确定你的数据库实例的字符集支持中文使用如下语句察看字符集:Select value$ from sys.props$ where name = 'NLS_NCHAR_CHARACTERSET'; 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 VALUE$--------------------------------------------------------------------------------ZHS16GBK结果是这个,说明什么呢? <%@ page contentType="text/html; charset=gb2312" language="java" errorPage="/error.jsp" %><%@ include file="/jstl.inc"%><html><head><title>Untitled Document</title><meta http-equiv="Content-Type" content="text/html; charset=gb2312"><LINK href="../../style.css" type=text/css rel=stylesheet></head><body><sql:update var="addCategory" dataSource="${shop}" sql="insert into category values('2','2','测试')"> </sql:update>更新成功</body></html>我直接写汉字也会是写入?? String xxx=new String(request.getParameter("xxx").getBytes("ISO-8859-1")); <% request.setCharacterEncoding("gb2312");%><sql:update var="addCategory" dataSource="${shop}" sql="insert into category values(?,?,?)"> <sql:param value="<%=request.getParameter("categoryId")%>"/> <sql:param value="<%=request.getParameter("name")%>"/> <sql:param value="<%=request.getParameter("desc")%>"/></sql:update>改成这个样子不可以吗?哪里有错呢? duty为所获得的字符串:String duty=request.getParameter("duty");duty=new String(duty.getBytes("ISO-8859-1"),"GBK");原理就是进行一下字符集转换,具体的就看你支持的字符集。 转了肯定是可以的,我也碰到了和你一样的问题,我得到了下REQUEST的字符集看了下是null 解决了。不用转。<%@ page contentType="text/html;charset=gb2312"%><% response.setContentType("text/html; charset=GB2312"); request.setCharacterEncoding("gb2312");%>然后把<form action="addCategory_do.jsp" method="get">方法改为post就可以了。 request.setCharacterEncoding("gb2312");就是这句话加上说可以了 表单里用get方法不可以吗?不清楚!学习! 请各位过来人来这看一下 jxl生成excel下拉框?急急急...... Java打印程序疑问??? jsp上传组件问题 各位老大 小弟又来了 JSP开发中的超链接传参数的错误显示问题!!! 高分!急!一个中文字符编码的怪问题 求一个页面跳转类。我们平时跳转的时候的那个 基础问题,如何搭建JSP的开发平台?那里下载软件,如何配制? jsp 和 asp.net 对比的话各有什么优缺点? JSP的一个runtime异常 高分求助!!请问有关在web开发中在全局的范围内管理客户端session的问题。
--------------------------------------------------------------------------------
ZHS16GBK结果是这个,说明什么呢?
<%@ include file="/jstl.inc"%><html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<LINK href="../../style.css" type=text/css rel=stylesheet>
</head>
<body>
<sql:update var="addCategory" dataSource="${shop}" sql="insert into category values('2','2','测试')">
</sql:update>
更新成功
</body>
</html>我直接写汉字也会是写入??
request.setCharacterEncoding("gb2312");
%><sql:update var="addCategory" dataSource="${shop}" sql="insert into category values(?,?,?)">
<sql:param value="<%=request.getParameter("categoryId")%>"/>
<sql:param value="<%=request.getParameter("name")%>"/>
<sql:param value="<%=request.getParameter("desc")%>"/>
</sql:update>改成这个样子不可以吗?哪里有错呢?
duty=new String(duty.getBytes("ISO-8859-1"),"GBK");原理就是进行一下字符集转换,具体的就看你支持的字符集。
<%@ page contentType="text/html;charset=gb2312"%>
<%
response.setContentType("text/html; charset=GB2312");
request.setCharacterEncoding("gb2312");
%>
然后把<form action="addCategory_do.jsp" method="get">方法改为post就可以了。
就是这句话
加上说可以了
不清楚!
学习!