Spring Boot- Static web resources : I'm new to spring mvc and static web resource and trying to rebuild a project ,but I have problem if someone can explain to me why the JS function not working?

About the project (Spring MVC web application using the Spring Boot framework. and use the JSP as view for the web application).

application.properties

    spring.mvc.view.prefix = /WEB-INF/views/
    spring.mvc.view.suffix = .jsp
    spring.mvc.static-path-pattern=/resources/**


MainApp.java

    package school.web.app;
    import org.springframework.boot.SpringApplication;
    import org.springframework.boot.autoconfigure.SpringBootApplication;
    
    @SpringBootApplication
    public class MainApp {
       public static void main(String[] args) {
          SpringApplication.run(MainApp.class, args);
       }
    }

HiController.java

    package school.web.app.controller;
    import org.springframework.stereotype.Controller;
    import org.springframework.ui.Model;
    import org.springframework.web.bind.annotation.PostMapping;
    import org.springframework.web.bind.annotation.RequestMapping;
    import org.springframework.web.bind.annotation.RequestParam;
    
    @Controller
    public class HiController {
    
       @RequestMapping("/")
       public String index() {
          return "index";
       }
    
       @PostMapping("/hello")
       public String sayHello(@RequestParam("name") String name, Model model) {
          model.addAttribute("name", name);
          return "hello";
       }
    }

style.css

    .form {
    	background-color: #efefef;
    	width: 400px;
    	height: 50px;
    	border-radius: 7px;
    	padding: 20px;
    }

app.js

    function validate() {
    	var name = document.getElementById("name").value;
    	if (name == '') {
    		alert('Please enter a valid name.');
    		return false;
    	} else {
    		return true;
    	}
    }

hello.jsp

    <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
    <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
    <!DOCTYPE html>
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
    <link href="${pageContext.request.contextPath}/resources/css/style.css" rel="stylesheet" >
    <title>SchoolApp</title>
    </head>
    <body>
      <h1>School WebApp</h1>
      <hr>
    
      <h2>Your name is ${name}</h2>
    
    </body>
    </html>

index.jsp

    <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
    <!DOCTYPE html>
    <html>
    <head>
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
    
    <!-- Static content -->
    
    <link href="${pageContext.request.contextPath}/resources/css/style.css" rel="stylesheet" >
    <script type="text/javascript" src="${pageContext.request.contextPath}/resources/js/app.js"></script>
    <title>SchoolApp</title>
    </head>
    <body>
      <h1>Spring Boot - MVC design</h1>
      <hr>
    
      <div class="form">
        <form action="hello" method="post" onsubmit="return validate()">
          <table>
            <tr>
              <td>Enter Your name</td>
              <td><input id="name" name="name"></td>
              <td><input type="submit" value="Submit"></td>
            </tr>
          </table>
        </form>
      </div>
    
    </body>
    </html>

pom.xml 

   

     <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
          <modelVersion>4.0.0</modelVersion>
          <groupId>school.web</groupId>
      <artifactId>school.web.app</artifactId>
          <version>0.0.1-SNAPSHOT</version>
          <properties>
            <java.version>1.8</java.version>
          </properties>
          <parent>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-parent</artifactId>
            <version>1.5.4.RELEASE</version>
          </parent>
          <dependencies>
            <dependency>
              <groupId>org.springframework.boot</groupId>
              <artifactId>spring-boot-starter-web</artifactId>
            </dependency>
        
            <!-- JSTL tag lib -->
            <dependency>
              <groupId>javax.servlet.jsp.jstl</groupId>
              <artifactId>javax.servlet.jsp.jstl-api</artifactId>
              <version>1.2.1</version>
            </dependency>
        
            <dependency>
              <groupId>taglibs</groupId>
              <artifactId>standard</artifactId>
              <version>1.1.2</version>
            </dependency>
        
            <!-- Tomcat for JSP rendering -->
            <dependency>
              <groupId>org.apache.tomcat.embed</groupId>
              <artifactId>tomcat-embed-jasper</artifactId>
              <scope>provided</scope>
            </dependency>
          </dependencies>
          <build>
            <plugins>
              <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
              </plugin>
            </plugins>
          </build>
          <packaging>war</packaging>
        </project>