servlet跳转到jsp页面问题~~~~~~在线等
...
request.setAttribute( "ELNPerPage ",new Integer(ELNPerPage));
request.getRequestDispatcher( "../reports/Inquire/qhdx.jsp ").forward(request,response);
return;
执行成功,但是跳转到下一个页面后
qhdx.jsp页面里面
Integer getELNPerPage = (Integer)request.getAttribute( "ELNPerPage ");
得到的居然是null,这是为什么呢???
大人们帮解决下,小弟基础比较差
------解决方案--------------------request.setAttribute( "ELNPerPage ",new Integer(ELNPerPage));
数据类型不匹配
------解决方案--------------------String ELNPerPage;
request.setAttribute( "ELNPerPage ",ELNPerPage);
应该没问题
------解决方案--------------------${requestScope.ELNPerPage}取值还不方便吗?
------解决方案--------------------request.setAttribute( "ELNPerPage ",new Integer(ELNPerPage));
如果ELNPerPage是int型就是对的···必须为Int的封装类。。
request.setAttribute(object,object); 两个参数都是Object