Integrating AngularJS in a JSP application using Spring-MVC

We have a JSP application developed with Spring-MVC which needs to integrate with AngularJS in some parts of user interaction.

We are running into a problem with urls. JSP application to construct the correct url uses <c:url/> which prepends the url with root path of a given application. We can of course source AnglularJS in a JSP. But, AngularJS uses internally many relative urls which end up being not found because they lack the root path of the web application. What can be done about it?

Example of AngularJS use of relative urls:

var app = angular.module("app", ['ngDragDrop', "ngRoute", "editor", "popup", "history", "state", "launch"])
        .config(function($routeProvider) {

            $routeProvider.otherwise({
                templateUrl: "res/views/actioner-view.html"
            });

        });


Source: jsp

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.