In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article mainly introduces the SpringMVC project visit controller report 404 how to do, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let the editor with you to understand.
SpringMVC reports 404 when visiting controller.
When I wrote the SpringMVC project, I suddenly found that the page displayed 404 when accessing the controller path, and the console did not report a serious error, only that the path could not be found and that it could be accessed normally by accessing jsp alone.
The console reported such an error.
No mapping found for HTTP request with URI [/ SpringWebScoket/user/login] in
All kinds of search methods on the Internet have not been solved.
First make a list of the various methods found.
1. Check the url path to see if it is written correctly. Sometimes it may be caused by the wrong path, such as the letter is written upside down, and cannot be found.
2. Whether MVC filtering is correct
SpringMVC /
Some friends say "/" and some friends say "/ *" in this configuration. I don't know which one is right. I can try them all.
3, static configuration, see some friends say, comment out the static configuration can be accessed, I do not know why.
There are others. I won't list them one by one here. I can't even try them all.
Finally solved.
Finally, I asked the god that there was a missing jar package for jackson-core, and cut out the configuration content in application.xml and paste it into the spring-mvc.xml configuration file. And then it was solved.
Possible reason why SpringMVC cannot access controller @ RequestMapping (value= "/ toplayindex", method= {RequestMethod.POST,RequestMethod.GET}) public ModelAndView toKpointPlay (HttpServletRequest request,@PathVariable ("Id") int Id) {/ / Code Block} Information from the Internet
@ PathVariable to get variables from the path
@ RequestParam is to get parameters from the request.
Thank you for reading this article carefully. I hope the article "what to do when the SpringMVC Project visits controller" shared by the editor will be helpful to everyone. At the same time, I also hope that you will support us and pay attention to the industry information channel. More related knowledge is waiting for you to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.