JAVA+TOMCAT+SSM HTTP Status 404-Error __java

Source: Internet
Author: User



Recently learning Java, because I was. NET to do Java encounter a lot of abnormal problems, make a note to deepen the impression. The SSM configuration is fine, but it's always 404 wrong.
But there is no problem with the home page:

Looking for, looking for 2 days finally found the reason: The URL is case-sensitive, for example: you in the Controller note: @RequestMapping ("/index") URL must also be capitalized: Http://localhost:8080/user/Index
Http://localhost:8080/user/Index Preview is as follows:
Http://localhost:8080/user/index Preview is as follows:

I changed the URL to uppercase: Http://localhost:8080/user/Index but still an error, as shown in figure:
Look for AH look for: Finally found the error: "Return"/user/userlist; "must be consistent with file name size. As shown in figure:

In fact, it is also very simple, the URL and the @RequestMapping ("/index") case is consistent, return and file is the same case.
First of all, also pay attention to the folder in Tomcat and JSP folder is the same case, I changed the user to user, but Tomcat webapps/root/the following generated folder or user, The specific reason: Target and WebApp in the project directory are not consistent, and tomcat generation is generated according to the files inside target.





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.