The various operations of the controller are dependent on the server boot and then inject a lot of functionality, so hot deployment often has no effect (because it is not injected, unless the object is defined in parentheses in the method name () [For example:
HttpServletResponse response
], because that is the way to access the method when the pass injection, but even in this way are prone to the problem of no effect, so this time to restart the server can be no effect when restarting the server can
1. Do not use a modelandview as a redirect, because it is used to specify the view, if you want to redirect to the. Action end or no suffix controller, then the return String to redirect the way,
Specifies that the view is Modelandview (through Test discovery: the way the direct return String is still stuck in the controller, so you need to use response for redirection in a special scenario)
2. The Controller class must write the @Controller annotation before it is created, or the controller will not be found
SPRINGMVC Controller FAQs