Home Answers Viewqa Java-Beginners method returning null on JSP page.Plz HELP!!!

 
 


ridhabh ssrtrt
method returning null on JSP page.Plz HELP!!!
0 Answer(s)      2 years ago
Posted in : Java Beginners

public String getServerAddress(String sName,int sPort,String pKey)
        {
            String sAddress = null;
            if(sPort>=0)
            {
                sAddress="http"+"://"+sName+":"+sPort+"/browser/"+pKey;
            }
            else
            {
                sAddress="http"+"://"+sName+"/browser/"+pKey;

            }
            System.out.println("sAddress at getServer method::::"+sAddress);
            return sAddress;

        }

When I am calling this method on the jsp page it is returning null while the parameter values are successfully passed.while I am trying to print the sAddress value here it is printing correct here. I am new to Java, so please help me as it could also because of some silly mistake. Thanks

View Answers









Related Pages:

Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.