Tire os aspas do null.
 
 String v_nome     = request.getParameter("v_nome");
    int v_total = 0;
    if (v_nome != null)
       {
         v_total    = 50;
       }
 
   if (v_nome != "")
       {
         v_total    = 50;
       }
 
 
 

Igor dos Santos Ferreira
------------------------
[EMAIL PROTECTED]

-----Original Message-----
From: José Vieira [mailto:[EMAIL PROTECTED]]
Sent: segunda-feira, 14 de outubro de 2002 09:50
To: [EMAIL PROTECTED]
Subject: [java-list] JSP String !=

  Olha Pessoal tenho uma String e gostaria de verificar se esta variavel é diferente de null, estou testando com um IF porem não estar funcionando, alguem poderia me ajudar?
 
    String v_nome     = request.getParameter("v_nome");
    int v_total = 0;
    if (v_nome != "null")
       {
         v_total    = 50;
       }
 
   if (v_nome != "")
       {
         v_total    = 50;
       }
 
 
 
Grato
 
José

Responder a