请教页面传参问题...小弟急啊!!!
大家好:
我在jsp页面接受参数 然后到数据库里进行相应的查询.在jbuilder 里一切正常,但当我打包发布到web服务器下就有问题了.当我选择按城市查询时,比如北京,可以找到很多条符合的数据,会有分页.然后显示在jsp页面中,但当我点击下一页的时候,'北京'这个参数就边成了乱码了.这里我打印了输出语句:
当显示第一页时
sqlStr==select top 50 User_id,Name,Eid,Gender,Hire_day,Hbmonth,Hbday,Job_function,Location,Reporting_manager,Bu from t_user where 1=1 and Gender ='F' and Location ='北京' order by User_id
当点击下一页时
sqlStr==select top 50 User_id,Name,Eid,Gender,Hire_day,Hbmonth,Hbday,Job_function,Location,Reporting_manager,Bu from t_user where 1=1 and Gender ='F' and Location ='±±??' order by User_id
这个是第二页网页传递的参数:
http://127.0.0.1:8080/datacenter/index1.jsp?page=2&Gender=F&Byear=&Bmonth=&Bday=&Hire_day=&Location=北京&Reporting_manager=&Host_manager=&Bu=
看起来都没问题,,可是在第二页'北京'为什么是乱码呢?
我已经在接受参数的语句中 写了request.setCharacterEncoding("GB2312");这句话,,真不知道问题出在哪里了.
我的环境是 sql2000+tomcat
请各位帮帮忙啊,, 老板就要review了..谢谢大家