dimanche 23 septembre 2018

resources under js directory are 404 in spring-boot web project

I am developing a spring-boot web project using mvc. I build a jar package locally and it works. However, I got all JS resources 404 error when the jar is deployed remotely.

I unzip the jar file, and the main directory under BOOT-INF/classes is:

[xx@l-monitor-server1.mgt.pre.aws.dm classes]$ tree static/
static/
├── css
│   ├── baseCore.css ...
│   ├── bootstrap.css
│   └── sb-admin-2.min.css
├── fonts
│   ├── FontAwesome.otf ..
│   ├── fontawesome-webfont.eot
│   ├── fontawesome-webfont.svg
│   └── glyphicons-halflings-regular.woff2
├── js
│   ├── baseCore.css
│   ├── bootstrap.js
│   ├── bootstrap.min.js
│   ├── dataTables.bootstrap.min.js
...
└── jstool
    ├── baseCore.css
    ├── bootstrap.js
    ├── bootstrap.min.js
    ├── dataTables.bootstrap.min.js
    └── sb-admin-2.min.js

  1. It is strange that other resources under css and fonts are OK.
    1. I copied the js directory to jstool, and the resources under jstool are also ok. 3, all resources under js fails with 404.

I have not found answer from spring-boot static content .

Is there any trick on the name js under static directory?




Aucun commentaire:

Enregistrer un commentaire