Before I was in the first company, I encountered this problem, the little brother put JS file into the web-inf below, let leader scold a meal, not graduated from me, immediately endure, the heart can only silently flow of tears, said: "Sorry, I was wrong!". Then the reason I did not understand, leader just said can not put, put it can not load. So the younger brother had to do, did not ask reason, only know web-inf can only put static resources, JS file can not put.
Today in the group, I saw someone asking this question, so I decided to sum up a little bit, for the programmer of us, make a little contribution. (Big God, please detour)
Security: Static resources in the Web-inf, the client access is not available, the server can access, that is, other people can not string change your code.
To make it easier for spring to map for you: The configuration file will have configuration information for static resources.
If you want to access the files directly in the page, you must map the files you want to access through the Web. xml file to access them.
Summary: In fact, is a sentence: "Security."
Why put static resources under the Web-inf?