Under Record springboot project with the pit mapping results in a static file inaccessible

  Some time ago the company made a new springboot + thymleaf project, beginning page is very simple, just use js and ajax requests native method, the original project 10.222.13.12 on the server, then map the project operation and maintenance personnel will address 10.222 .13.140 / lmj this address, and then found directly on the static files in less than full access to the file static, just thought it was because of the use of a common reference not

<Script src = "/ js / jQuery-1.8.2.js"> </ Script> , then go online to find a lot of references js file with thymleaf framework, different reference static files found thymleaf writing, into a <script th: = the src "@ {/ JS / jQuery-1.8.2.js}"> </ Script> , later found to be particularly surprising that no problems with local test writing a first, a second may be, but into a will be a problem on the server is not accessible, to find the problem to find a headache, operation and maintenance also asked not to find a solution, it was later found in static or folder to build a lmj folder, and then js files into this directory you can access the <TH Script: src = "@ {/ LMJ / JS / jQuery-1.8.2.js}"> </ Script> , really silent, too dishes do not know in the end is what principle, but the problem solved like, record it!

Guess you like

Origin www.cnblogs.com/suiyuebulaorenxin/p/12469754.html