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.