<%@ page contentType="text/html; charset=gb2312" import="java.sql.*" %>要放到页首!registor.jsp中显示的用户名是中文吗?如果不是将registor.htm该成jsp文件,文件头加上<%@ page contentType="text/html; charset=gb2312">
解决方案 »
- 在dos窗口运行cxf apache-cxf-2.1.3\bin下面的wsdl2java.bat时报错如下。 环境变量已设置:如下:
- 求java正则表达式
- java调用linux命令带星号的问题
- 网页提交post方式,如果某一个参数是否存在不确定,应该如何判断?
- java方向应用领域?
- 品高软件 笔试
- 下面这个例子如何体现List集合的有序性?
- 一個簡單的struts問題
- Apache SOAP的Web Services在Tomcat4.0.4的安装和测试的问题
- 求教,怎能从命令行手动生成weblogic7的描述符
- 开发EJB需要哪些个类库(包)?从哪里获得?
- 请各位前辈介绍几本学习j2ee的好书
用request.getParameter()从registor.htm取得的值传到registor.jsp中时就已经是乱码了。
到底应该则么办?
将registor.htm该成jsp文件,文件头加上<%@ page contentType="text/html;
charset=gb2312">
的方法也试过了,都不行!
1、
<%@page contentType="text/html;charset=GB2312"%>2、所有从表单接收的参数都要按如下规格接收:
String username=request.getParameter("username");
username = new String( username.getBytes(), "GB2312" );String password=request.getParameter("password");
password = new String( password.getBytes(), "GB2312" );..........
当然你可以把
new String( username.getBytes(), "GB2312" );
做成一个函数去调用
String str = new String(读出的str.getByte(),"GB2312");
<%
request.setCharacterEncoding("GB2312");
%>
hitywt(^-^)