如何将servlet中的int值传到jsp中,请问你是如何解决的

[复制链接]
查看11 | 回复3 | 2011-7-29 09:57:20 | 显示全部楼层 |阅读模式
其一:在servlet中将int值用:request.setAttribute('intvalue',11);保存其二:在jsp页面中,取值String str = request.getAttribute("intvalue");int intvalue= Integer.parseInt(str);...
回复

使用道具 举报

千问 | 2011-7-29 09:57:20 | 显示全部楼层
request.setAttribute("intvalue","111");String xx = request.getAttribute("intvalue");int xxint = Integer.valueOf(xx);...
回复

使用道具 举报

千问 | 2011-7-29 09:57:20 | 显示全部楼层
1,可以用struts标签取,2,直接就request.getParameter("XX");这个取到Sring,然后,再转型就行了,3,用${name}...
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行