网页提交的时候,A.JSP文件接收参数:
request.getParameter("timeValue");如果:有时参数timeValue会传来值
有时就不会传来这个参数。我这样写的:
if(timeValue.equals(""))                  
{
....
}    
else                                  
{
....
}
上面判断是否为空值,不行啊
该怎么作判断?

解决方案 »

  1.   

    表单没有name的时候,request.getParameter("name"); 是 null
    表单有name而没有填写时,request.getParameter("name"); 是“”
     
      

  2.   

    if(timeValue==null)                  
    {
        ....
    }                           
    else                                  
    {
        ....
    }    
      

  3.   

    if(timeValue==null || timeValue.equals(""))                  
    {
        //清空次数(或时间)显示
    }                           
    else                                  
    {
        //显示次数(或时间)
    }    
      

  4.   

    应 该 是 null 吧