如题,想接收前面表单的值,之前图片已上传成功,但是其它表单的值使终为??????
试了很多方法,还不行,
<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %>
<%
request.setCharacterEncoding("GBK");
SmartUpload mySmartUpload =new SmartUpload();
mySmartUpload.initialize(pageContext);
mySmartUpload.upload();
-------------------
String name1=mySmartUpload.getRequest().getParameter("name").trim();
不行
-------------------
String str=mySmartUpload.getRequest().getParameter("name");
byte b[]=str.getBytes("ISO-8859-1");
str=new String(b);
还不行?
--------------
还没有涉及数据库,所以不用考虑!
急!
试了很多方法,还不行,
<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %>
<%
request.setCharacterEncoding("GBK");
SmartUpload mySmartUpload =new SmartUpload();
mySmartUpload.initialize(pageContext);
mySmartUpload.upload();
-------------------
String name1=mySmartUpload.getRequest().getParameter("name").trim();
不行
-------------------
String str=mySmartUpload.getRequest().getParameter("name");
byte b[]=str.getBytes("ISO-8859-1");
str=new String(b);
还不行?
--------------
还没有涉及数据库,所以不用考虑!
急!
表单用post提交,那server接受的就应该不存在乱码不设置method,默认以get提交 比如name=a
server String a = new String(request.getParameter("a").getBytes("iso-8859-1"), "gb2312");
这个a就应该不存在乱码
out.print(a);
我是这样写的,果然可以了,没有?号了,这样是说明我那个在什么地方有问题呢
那我下面要用什么方法做呢,因为用GET是只数值限制的吧,我在PHP里听过。
现在只能用GET来接收。
http://download.csdn.net/source/608182▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲
http://download.csdn.net/source/608182▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲