请教session的问题 所以返回才是null啊,有什么问题吗 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 第一次访问的时候是没有count属性,所以要set一个初始值1;后面访问的时候,session已经有了count属性,就直接取值++。不知道有没有解决你的疑惑? 还没有session.setAttribute("count", count)就可以session.getAttribute("count")吗getAttribute可以在setAttribute之前吗 还没有session.setAttribute("count", count)就可以session.getAttribute("count")吗getAttribute可以在setAttribute之前吗没有该属性的时候,返回null 调用不分先后的,找了下tomcat的session实现类StandardSession public Object getAttribute(String name) { if (!isValidInternal()) { throw new IllegalStateException(sm.getString("standardSession.getAttribute.ise")); } if (name == null) return null; return this.attributes.get(name); }这样就比较清晰了 spring事务及回滚问题,求助~~~ 关于JavaScript,客户端判断提交是否为空值的问题... ssh2中如何像asp.net的PageLoad()一样进入一个页面,直接从服务器取值 小弟想看看struts2的源码 希望有经验的人 给个好的学习策略 试问版主这样的帖子有何置顶的必要 JavaEE servlet 求教:数据库插件该怎么做? TimerTask问题 有谁给推荐几款性价比好一点的JSP虚拟主机!!! 经典中国人必看的博客。。。。。。。 学习处于停滞状态 替换包含转义字符及空格的字串
不知道有没有解决你的疑惑?
还没有session.setAttribute("count", count)就可以session.getAttribute("count")吗getAttribute可以在setAttribute之前吗
还没有session.setAttribute("count", count)就可以session.getAttribute("count")吗getAttribute可以在setAttribute之前吗
没有该属性的时候,返回null
public Object getAttribute(String name)
{
if (!isValidInternal()) {
throw new IllegalStateException(sm.getString("standardSession.getAttribute.ise"));
} if (name == null) return null; return this.attributes.get(name);
}
这样就比较清晰了