Springboot + tomcat + JSP report whitelabel Error page Solution __js

Source: Internet
Author: User

It is said that Springboot is a fast-built development framework, just like trying. However, in the use of the process found that after adding a JSP in accordance with the original SPRINGMVC way reported whitelabel error page errors, check all the similar problems encountered on the Internet, roughly as follows:

[HTML] view plain copy <span style= "FONT-SIZE:18PX;"      >whitelabel Error Page This application has no explicit mapping for/error, so you are seeing this as a fallback.   Sun June 09:07:08 CST 2017 There was a unexpected error (Type=not Found, status=404). No message available</span>
The problem is very much like no access to the address is wrong, the first feeling that the URL is not written.


In fact, the real reason is that the "Application boot class is misplaced" to put the application on the outermost layer, which is to include all the child packages.


For example, your groupid is com.google, the child package is called com.google.xxx, so the application class should be placed under the Com.google package.


Springboot automatically loads all the components under the package where the startup class is located and under its child packages.


After the investigation does not exist this problem, there are some other solutions are tried or not. Finally found on the spring website


This demo, we all know that JSP is dependent on the servlet container to run, see demo following code:


The Spring boot entry class needs to inherit the Springbootservletinitializer Servlet initialization class, so that's OK.

Related Article

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.