answersLogoWhite

0


Best Answer

The host name and the ip address is present in the HttpRequest object. Usually it is passed as an argument to the doXXX methods.

public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException {

// Get client's IP address

String ipAddress = req.getRemoteAddr();

// Get client's hostname

String hostname = req.getRemoteHost();

}

User Avatar

Wiki User

14y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do you display the host name and ip address using Servlets?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What action is taken by a host on an Ethernet network when the host attempts to contact a remote host on another network?

The packet is sent using the IP address and MAC address of the default gateway.


What should you check if you can connect using the IP address but NOT with he host name?

DNS


For the address 1101 0110 1001 0010 1110 0111 0100 1101 give its address class the subnet address the broad cast address and host address if sub netting is done using the last 5 bit for the host?

3675309


What is the IP address of powercom?

You can find the IP address of power.com by using http://www.ip-details.com/domain-host-search/ .


Using the ip address and subnet mask shown write out the host address between these number 222.49.49.11 255.255.255.0?

222.49.49.0


What is the netstat command in Linux?

netstat----------most useful and very versatile for finding connection to and from the host. you can find out all the mulitcast groups (network) subscribed by this host by issuing "netstat -g"netstat -nap | grep port will display process id of application which is using that portnetstat -a will display all connections including tcp and udpnetstat --tcp will display only tcp connectionnetstat --udp will display only udp connectionnetstat -g will display all multicast network subscribed by this host.


What is the kkkcom website ip address?

You can find the IP address of KKK.com website by using http://www.ip-details.com/domain-host-search/ .


What is the IP address of the site orkut?

You can find the IP address of the site Orkut by using http://www.ip-details.com/domain-host-search/ .


What allows a host to obtain an IP address dynamically when it connects to the network?

Its very simple one when the host connects to the network it is DHCP dynamic host control protocol which is used to assign the IP address to the address seeking hosts in the network. it simply take any IP address from the pool of IP address and assign on to the host on lease based after using this must be sent back to the DHCP server ( your router in most cases )


What is IP Host address?

The host is the last part of an IP address


How to find ip address of yahoo mail?

You can find the IP address for yahoo mail by using http://www.ip-details.com/domain-host-search/ .


The IP address of a given host might change each time it comes onto a network?

The IP address of a given host might change each time it comes onto a network if it is using a proxy server. A proxy server makes it hard to locate the person using the internet.