Night God simulator access to local tomcat server test: Failed

Source: Internet
Author: User

After the green version of Tomcat decompression, enter http://localhost:8080/in the browser (the default port is 8080, can be modified in the configuration file), the following page appears:

This page from:/apache-tomcat-8.0.26/webapps/root/index.jsp

In Java EE application Development, we typically use localhost or 127.0.0.1来 to access the native Web service. If the same address is used in the Android emulator

Access, the Android emulator will not have normal access to the services deployed on Tomcat. Imagine:Android is the Linux kernel, Android itself is

an operating system ; So at this point, the localhost or 127.0.0.1 that we entered in the emulator's browser represents the Android emulator (Android virtual machine), and

It's not your computer. This is why you will be quoted as "Page not found" when you use localhost in the simulator.

On the Android operating system, map the address of the local computer to 10.0.2.2; Therefore, you only need to change the original localhost or 127.0.0.1 to 10.0.2.2, you can

To access Tomcat on the emulator and the resources and services deployed on Tomcat. Now we'll start Tomcat on the computer:

    Now start the Android simulator (), open the emulator on the

browser, Then access: http://10.0.2.2:8080/, theoretically You can see the Tomcat cat. (ps:tomcat default service port is 8080)

However, the fact is that the results are as follows:


Conclusion: Both the official simulator and the hippocampus play simulator can be accessed via http://10.0.2.2:8080/ to the local tomcat server, but the night gods cannot access the local tomcat

server , the specific reason is not clear at the moment, so with the late-night Test of the small partners, change a simulator to try it.

Night God simulator access to local tomcat server test: Failed

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.