The difference between return "" and return "redirect: " of springmvc

the difference:

return "user/welcome" will automatically jump to user/welcome.jsp under WEB-INF/. 


And return "redirect: user/welcome" will return the controller, and then re-find the requestmapping parameters. If the controller does not have a @requestmapping(value="user"), then an error will be reported. 

Therefore, the return+path is purely used to jump pages. And return+redirect is used to turn to the controller again.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326503877&siteId=291194637