springMVC
配置好@RequestMapping 但是前端页面访问不到。错误404。
原因:
配置好@RequsetMapping,但前端访问错误404
配置dispartServlet时 需指定配置文件。如果指定的配置文件扫描不到@Controller所在的包,则无法找到@RequsetMapping。
解决方案:
指定的配置文件,需要有
<context:component-scan base-package="(controller所在的包)"></context:component-scan>

相关文章:

  • 2021-11-30
  • 2021-12-23
  • 2021-12-26
  • 2022-02-26
  • 2022-12-23
  • 2022-12-23
  • 2021-09-03
猜你喜欢
  • 2021-12-09
  • 2022-02-17
  • 2021-09-01
  • 2022-12-23
  • 2022-01-20
  • 2021-12-29
相关资源
相似解决方案