解决乱码问题~!传值中文不成功`!请老鸟指教`!
//String submit= request.getParameter( "Submit ");
String submit=new String(request.getParameter( "submit ").getBytes( "iso-8859-1 "), "gbk ");
if(submit.equals( "注册 ")){
response.sendRedirect( "jsp2.jsp ");
}else{
response.sendRedirect( "jsp3.jsp ");
}
在JSP页面中定义的value= "注册 "
运行后报个500错误~!请老鸟给小弟看看~!
小弟在此谢过`!!!
------解决方案--------------------加一个过滤器,设置 request.setCharacterEncoding( "GB2312 ")
------解决方案--------------------直接在最前面加一句request.setCharacterEncoding( "GBK ");
在上一个页面中设置 <%@ page pageEncoding= "GBK "%>