Home  >  Q&A  >  body text

java-web - Why can't HBuilder real-machine debugging request the locally running java background project interface?

1. Why can’t HBuilder real-machine debugging request the locally running Java background project interface?
2. The front end uses the mui framework to generate the real-machine test app and request the locally running Java background project.
mui.ajax( 'http://192.168.1.124:8080/tes...',{
//mui.ajax('http://localhost:8080/test/de...',{

                data:'',
                async:true,
                dataType:'json',   
                type:'post',
                success:function(list){
                    console.log(list);
                    console.log(JSON.stringify(list));
                },
                error:function(){                        
                    console.log("Damn it!+请求失败")
                }
            });
  1. When the page is requested, ajax cannot request the background interface? Even if both addresses are written in the same way, it won’t work??
    Note: If you run the background project on another computer, you can send requests.

  2. Hbuilder and the tomcat port running in the java background are on the same computer. There is no conflict. Why can't it be requested?

大家讲道理大家讲道理2702 days ago874

reply all(1)I'll reply

  • 怪我咯

    怪我咯2017-05-27 17:42:33

    localhost refers to the local machine. For mobile phones, it is the mobile phone itself and not your PC, so you cannot access the interface on your PC

    reply
    0
  • Cancelreply