这是我的一段代码,当程序执行到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();
    %>