mardi 6 avril 2021

Java if/else statements not working on server [closed]

I have written some code with some nested If statements. I have debugged in Eclipse and it is working as expected. However when I deploy the code to the live tomcat server, I am able to see that resp is getting populated, but the println in the else statement is not being hit. What could be different locally than on the server?

if (env.equals("") || env.isEmpty())
        {
            resp = getLocationJSONResponse(token, locDetails.getID(), "QA");
            
            if (resp.equals("No Content") || resp.isEmpty())
            {
                resp = getLocationJSONResponse(token, locDetails.getID(), "MIT");
                
                if (resp.equals("No Content") || resp.isEmpty())
                {
                    blnFound = false;
                    return blnFound;
                }
                else
                {
                    locDetails.setEnv("MIT"); 
                    System.out.println("env in = " + locDetails.getEnv());
                    env = "MIT";
                }
            }
            else
            {
                locDetails.setEnv("QA"); 
                System.out.println("env in = " + locDetails.getEnv());
                env = "QA";                     
            }
        }
        else
            resp = getLocationJSONResponse(token, locDetails.getID(), env);

Aucun commentaire:

Enregistrer un commentaire