0

I am creating an NDV3 AngularJS graph demo with IntelliJ.

I have created a standard html file (index.html) and added all the necessary AngularJS and NDV3 libraries in a folder (bower_components) within the resources folder (defined as resource).

I have then added all the required code inside the html file, including the aforementioned libraries via script tags.

When I run the application however the screen is blank, meaning that the libraries haven't been picked up somehow.

Does anyone know what am I doing wrong?

enter image description here

enter image description here

Anto
  • 4,265
  • 14
  • 63
  • 113

2 Answers2

1

I have create and test an app just like your..

web.xml

<!DOCTYPE web-app PUBLIC
 "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
 "http://java.sun.com/dtd/web-app_2_3.dtd" >

<web-app>
  <display-name>Archetype Created Web Application</display-name>
</web-app>

index.html

<!doctype html>
<html lang="en" ng-app="phonecat">
<head>
  <meta charset="utf-8">
  <title>Google Phone Gallery</title>
  <link rel="stylesheet" href="css/app.css">
  <link rel="stylesheet" href="css/bootstrap.css">
  <script src="/resources/bower_components/angular/angular.js"></script>
  <script src="js/app.js"></script>
  <script src="js/controllers.js"></script>
  <script src="js/filters.js"></script>
  <script src="js/services.js"></script>
  <script src="/resources/bower_components/angular/angular-resource.js"></script>
</head>
<body>

  <div ng-view></div>

</body>
</html>

it works for me..

Problem lies into your java script file src attribute, it is not pointed properly to js file

<script src="resources/bower_components/angular/angular.js"></script>

change into

<script src="/resources/bower_components/angular/angular.js"></script>

i beleive you problem will be solved

  • Hi Jaihrul, I have just realized that AngularJS works fine, it's picked up correctly. The centre of the problem lies in the NVD3-based libraries, somehow they are not picked up. Many thanks for your help. – Anto May 14 '16 at 10:26
0

Check following link

static file mapping

another post

<servlet>       
  <servlet-name>default</servlet-name>         
  <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>     
</servlet> 

<servlet-mapping>
            <servlet-name>default</servlet-name>
            <url-pattern>/resources/*</url-pattern>
    </servlet-mapping>
Community
  • 1
  • 1