这是我的一段代码,当程序执行到if 的时候出错,不明白事怎么回事
<%
String nbid="";
int hits=0;
nbid=request.getParameter("nbid");
HashMap hm;
hm=(HashMap)application.getAttribute("hits");
System.out.println("application have got");
if(!hm.containsKey(nbid))
{
System.out.println(nbid);
hm.put(nbid,1);
}
else{
int i=Integer.parseInt(hm.get(nbid).toString());
hm.put(nbid,i+1);
}
application.setAttribute("hits",hm);
System.out.println("application have set");
HitsStat hs=new HitsStat();
hs.OperatDB(hm);
hm.clear();
%>
<%
String nbid="";
int hits=0;
nbid=request.getParameter("nbid");
HashMap hm;
hm=(HashMap)application.getAttribute("hits");
System.out.println("application have got");
if(!hm.containsKey(nbid))
{
System.out.println(nbid);
hm.put(nbid,1);
}
else{
int i=Integer.parseInt(hm.get(nbid).toString());
hm.put(nbid,i+1);
}
application.setAttribute("hits",hm);
System.out.println("application have set");
HitsStat hs=new HitsStat();
hs.OperatDB(hm);
hm.clear();
%>
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货