spring boot angularjs spring data jpa crud-app example 在 eclipse 中出现 404 错误

spring boot angularjs spring data jpa crud-app example get 404 error in eclipse

http://websystique.com/spring-boot/spring-boot-angularjs-spring-data-jpa-crud-app-example/ 我已经从教程中导入了这个项目,它运行完美,没有任何错误。但是为了查看它使用 index.ftl,它在 eclipse 中显示 404 错误。

我的application.yml文件

---
server:
  port: 8080
  contextPath: /SpringBootCRUDApp
---
spring:
  profiles: local, default
datasource:
  sampleapp:
    url: jdbc:h2:~/emp
    username: sa
    password: 
    driverClassName: org.h2.Driver
    defaultSchema:
    maxPoolSize: 10
    hibernate:
      hbm2ddl.method: create-drop
      show_sql: true
      format_sql: true
      dialect: org.hibernate.dialect.H2Dialect
---
spring:
  profiles: prod
datasource:
  sampleapp:
    url: jdbc:mysql://localhost:3306/emp
    username: root
    password: root
    driverClassName: com.mysql.jdbc.Driver
    defaultSchema:
    maxPoolSize: 20
    hibernate:
      hbm2ddl.method: update
      show_sql: true
      format_sql: true
      dialect: org.hibernate.dialect.MySQLDialect

相信您的应用已经启动成功。

你应该使用 http://localhost:8080/SpringBootCRUDApp ..

此应用程序是一个 spring 启动应用程序,就像一个独立的应用程序(它使用内部 tomcat),不需要外部 tomcat。您必须使用 maven 或直接从应用程序 class 启动它。

  1. 如果您已经 运行,请停止任何服务器。
  2. 在项目中转到 class SpringBootCRUDApp -> 右键单击​​ -> 运行 作为 Spring 启动应用程序。现在,您应该会看到应用程序正在启动。

启动后,转到浏览器并输入此 URL http://localhost:8080/SpringBootCRUDApp。您应该会看到如上所示的屏幕。