判断字符串相等,不等应该用 equals 方法,不是 == String getParameter(String name) Returns the value of a request parameter as a String, or null if the parameter does not exist. Request parameters are extra information sent with the request. For HTTP servlets, parameters are contained in the query string or posted form data. 如果参数不存在,则为null
楼主的情况,获取到的参数应该为空字符串 "" 楼主试着通过if ( !("".equals(oldpd))  &&  !("".equals(pd1))  &&  !("".equals(pd2))) {
      // your code
}
试试看

解决方案 »

  1.   

    用空间传值的空文本框  传过去的值是空字符串  不是null
      

  2.   

    如果你不想空格传递,那么可以使用
    if ( pd1 != null && !pd1.trim().equals(""))
    就可以了啊 
      

  3.   

    1楼正解,oldpd!=null  判断的是当有oldpd这个参数传过来的时候就满足,判断的是否是空参,用equals判断才是否是空串
      

  4.   

    推荐个楼主一个类用来判断当前字符串是否为空字符串或null。
    StringUtils.isNotBlank(变量)  返回boolean
      

  5.   

    参数不存在得到的是NULL,参数存在但是没有值得到的是“”。