SpringMvc startup can successfully access the homepage, access other paths 404

You can enter the home page, indicating that there is no error in the core position

Reason investigation:

The controller class does not add @Controller

Possible Causes:

1. Check if your controller class has @Controller added

2. Check whether the path in your @RequestMapping() is consistent with the access path of your jsp

problem solved:

1. Add the @Controller annotation to the controller class

2. Add the following statement in springmvc-servlet.xml

<bean name="/hello" class="Controller.helloController"></bean>

Guess you like

Origin blog.csdn.net/qq_56044050/article/details/124195884
Recommended