Anto
Anto

Reputation: 4305

JS libraries in IntelliJ are not picked up

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

Upvotes: 0

Views: 211

Answers (2)

Jahirul Islam Bhuiyan
Jahirul Islam Bhuiyan

Reputation: 799

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

Upvotes: 1

Jahirul Islam Bhuiyan
Jahirul Islam Bhuiyan

Reputation: 799

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>

Upvotes: 0

Related Questions