jsp数据类型问题

来源:百度知道 编辑:UC知道 时间:2024/06/18 05:10:59
int pageIndex=request.getQueryString("p");
错误提示:
The method getQueryString() in the type HttpServletRequest is not applicable for the arguments

int pageIndex=request.getParameter("p")
错误提示:
Type mismatch: cannot convert from String to int

不明白为什么啊
我一用IE从DreamWeaver里打开就出错了

int pageIndex=Integer.parseInt(request.getQueryString("p"));

昏.....getQueryString("p")这个是接收到一个字串型的值.

当然不能INT型的PAGEINDEX来赋值.

同上

request取出的值都是字符型,需要类型转换
int pageIndex=Integer.parseInt(request.getQueryString("p"));