关于equals判断的对象值不能为null
<%
String str=request.getParameter("rdChoice");
if (str==null) //增加对str是否为null的检测
{
str="";
}
/*Integer */
int count=(Integer)application.getAttribute("hitCounter");
// if(count==null || count==0)
if(str.equals("A")) //如果str=null,那么EL表达式将会产生500错误=空指针异常
{
a++;
count++;
}
Integer:转化数据类型为整型
integer.parseInt:int t=Integer.parseInt(string obj);
转化数据为整数
与js类似