Im a Rookie in Angular JS. I'm using the Spring MVC model and would like to get the contextPath from Tomcat (localthost:8080>>>/test<<<).
What I need is a variable that stores the value of "${pageContext.request.contextPath}" from a JSP and pass that variable to the config.
Is it possible to pass that value to the config? And if not: is there another or even better way?
Ive searched stackoverflow, but only found one answer but must confess I didn't understand it since it hadnt much code to go for: Whats the better way to identify the context path in Angular JS
App.js
(function() {
var app = angular.module('testApp', [ 'ngRoute']);
app.config(function($routeProvider) {
$routeProvider.when('/', {
templateUrl : '/home',
})
;
});
}());
HomeController.java
@Controller
public class HomeController {
@RequestMapping("/home")
public String showHomereg(){
return "content/index.jsp";
}
The way its shown here will direct me to "localhost:8080/home" instead of "localhost:8080/test/home"