Linked Questions
26 questions linked to/from Recommended way to get hostname in Java
0 votes
1 answer
3k views
Get host name in java
I am using jdk 8 with weblogic server 12 R2c. My application is public facing and i need to get the host name of the client. If the client host name is in the list of allowed host names which can ...
0 votes
1 answer
2k views
How to get server host name using Java while starting the server
I want to get the server hostname using Java while starting the server. Before that i was used HTTP servlet request but I cannot get the request during start the server it's shows null pointer ...
2 votes
1 answer
1k views
Let a webapp be aware of the host and port it is being hosted on
I host my java/jsp based webapps using tomcat 7.0. I would like to make my webapps be able to invoke requests from other webapps (on the same machine). To do this, they need to know the url from which ...
1 vote
1 answer
1k views
Why does Java hide their getLocalHostName() implementation?
Asking how to find the current machine's host name is one of the more frequent Java questions here and in other programming forums, and the common answer - InetAddress.getLocalHost().getHostName() is ...
1 vote
1 answer
573 views
Java app not working properly when started as service
I am working on an application created using the spring IO framework which displays the hostname using a json format. The application is working fine when it is started from the command line by the ...
1 vote
3 answers
443 views
Check whether given host name (say "abc.xyz.com") is localhost
I want to know whether a given hostname (which can be FQDN also) is localhost. I didn't find any direct API in InetAddress which can tell me so. What is the best way to do that? Edit: I think I didn'...
-1 votes
2 answers
178 views
Developing Networking Security Applications & System utilities in Java
I come from a C/Linux background and don't have much background in Java. I generally develop system administrator utilities like : disk cleanup retrieve lost data / files repairing file systems ...
0 votes
0 answers
138 views
Environment variable not accessible if Apache Camel run in Crontab of Centos
I have one jar file which contain camel route to run it from cron job i created shell script public void process(Exchange exchange) throws Exception { String host=exchange.getContext()....
0 votes
1 answer
106 views
How to obtain full host name?
when I write following code in cmd: ping localhost I see following result: Pinging hostname.A.B.com [::1] with 32 bytes of data: Reply from ::1: time<1ms Reply from ::1: time<1ms Reply from ::...
0 votes
1 answer
60 views
How to point to different database from single war file at run time using spring data jpa
I am having a spring boot application. It is having rest end points which are consumed by angular application. My application is hosted on tomcat server. myapp1.mydomain.com -> My War File -> ...
0 votes
1 answer
39 views
Java Server client and hos name computer
I made a simple java client server program its work very well on my computer (localhost) but when I run the server on my computer and the client on friend computer I don't know how to get my full ...