Whats the better way to identify the context path in Angular JS

后端 未结 7 1058
清酒与你
清酒与你 2021-02-05 20:38

I have my web application deployed to tomcat with an applicatio context. For example my URL looks something like this.

http://localhost:8080/myapp
7条回答
  •  长发绾君心
    2021-02-05 21:07

    I'm also using tomcat and Spring MVC. Using relative url in JavaScript will do the trick.

    For doing this you just need to remove the / at the begining of REST url. so that your url starts from the current url in your browser.

    replace $resource('/getusers') with $resource('getusers')

提交回复
热议问题