Substitua por
 
String v_nome     = request.getParameter("v_nome");
    int v_total = 0;
    if (v_nome != null// sem aspas
       {
         v_total    = 50;
       }
 
   if (!v_nome.equals(""))
       {
         v_total    = 50;
       }
 

---
Jonatan Schroeder
[EMAIL PROTECTED]
 
 
----- Original Message -----
Sent: Monday, October 14, 2002 9:49 AM
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