0

I have developed a webpage and hosted it using tomcat server. I connected my PC to hot spot of my android mobile. I tried to access the webpage hosted on localhost from my mobile browser. I got the following error.

  HTTP STATUS 404 - [location specified in URL] 
  TYPE : status report
  MESSAGE: [location specified in URL]
  DESCRIPTION : the requested resource is not available

I followed as specified inlink what i am missing

what I am missing?

Community
  • 1
  • 1
user3702247
  • 61
  • 1
  • 9

2 Answers2

1

Connect both your PC and phone to the same WiFi network and instead of "localhost" use your PC's IP address and whatever port tomcat is running on. It'll probably be something like http://192.168.1.10:8080/

darnmason
  • 2,672
  • 1
  • 17
  • 23
0

Localhost would work only in the local PC. Even if it is mobile emulator, localhost would not work.

Steps to Do:

Host the tomcat server in your local PC with IP say, 170.17.7.1 and start the server (Possibly in 8080 port).

Try the server URL from the browser say: http://170.17.7.1:8080/MyWebAppURL and check if it is getting hit by verifying Tomcat logs.

Now try hitting the URL from your wi-fi enabled mobile Phone.

ngrashia
  • 9,869
  • 5
  • 43
  • 58