A summary of how the MAVEN-based spring boot project is deployed to Tomcat. js file failure handling idea

Source: Internet
Author: User

Not long ago, a problem was encountered: a good project running on Eclipse, JS will not work properly after deploying to Tomcat.

On the internet to find a lot of articles, there is no good solution to this problem, finally can only step by step to troubleshoot.

  1. The problem with deploying the environment is still the problem with Tomcat: Deploying in Tomcat on this machine, starting, and discovering that JS is still invalid--and that is the problem that Tomcat is causing.

  2. View the page source code through the browser to find all the JS files are imported normally, while viewing class/static, all the resources below are present.

  3. Delete all JS, write alert (1), can actually display. Before each JS import statement, add the

    <script type= "Text/javascript" > Alert (n) </script> Finally, it is the problem of jquery. A closer look at the discovery is a case-sensitive issue. class/static/js/the following jquery, while the import was written in jquery.


Summary: Eclipse will automatically equate jquery with jquery, while Tomcat has strict casing requirements. Although the problem is small but very pit, it will make people feel puzzled.

This article is from the "11878300" blog, please be sure to keep this source http://11888300.blog.51cto.com/11878300/1828699

A summary of how the MAVEN-based spring boot project is deployed to Tomcat. js file failure handling idea

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.