Tablet web app not loading

On a PC with a Windows 8.1 server (called srv) I installed Tomcat as a service, and when I launch the application from the computer, I can run the application through srv:8080/myWebApplication from my browser. However, when I try to run the application from the table, it seems that srv not recognized and the browser is not loading anything. When I try to execute 192.168.0.2:8080/myWebApplication , the application loads fine.

Why does the first method not work on tablets?

+6
source share
2 answers

This only happens because your tablet does not know the name "srv" that you use to access your web application. You must edit your “hosts file” on your tablet if it runs on Android OS. If you do not know what the “hosts file” is, look at the Windows \ System32 \ drivers \ etc \ hosts file. This is a mapping file for server name ↔ IP

To learn how to edit the hosts file on Android tablets, follow these steps:

https://android.stackexchange.com/questions/60150/how-to-edit-etc-hosts-file

+4
source

Since you do not have a server application / web server running on your tablet
localhost is equivalent to 127.0.0.1

localhost - wikipedia

On a computer network, localhost is the host name that this computer means. It can be used to access network services that run on a host through its network loopback interface. Using a loopback interface bypasses any hardware on the local network interface.

So, if you want to send rquest to the server, you must specify the host using your IP address

+3
source

All Articles