这句判断不对: if (d!=null)
实际上,如果你不输入时间,
d=request.getParameter("dtime")得到的是空,而不是null
你应该改成:
d.trim()!=""