In my application I use request.getServerName. It returns a null pointer exception. Is there anywhere I can set the server name? For example in server.xml. And how can I set it?
>>>> request.getServerName. It returns a null pointer exception.
This method returns a String of the server's name - not a "NullPointerException". You need to work out whether your application is barfing on an NPE because you have done an operation on the String set from that method, or whether the request object is null .... print out the request object alone, and then the getServerName() method's return value to check this.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.