今天遇到了一个问题: 
使用SpringMVC时,出现页面无法跳转的情况(404错误), 
出现这个异常的原因在于SpringMVC的配置文件中控制器的配置书写错误: 
原代码:

<context:component-scan base-package="com.packagename1.controller" />

出现问题的原因在于包名不应该写到controller层面: 
改为下面的即可实现成功跳转。

<context:component-scan base-package="com.packagename1" />

 

相关文章:

  • 2022-12-23
  • 2021-05-11
  • 2021-05-12
  • 2022-12-23
  • 2021-09-03
  • 2021-07-27
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-12-30
  • 2021-04-24
  • 2021-05-23
  • 2021-07-26
  • 2021-07-13
  • 2021-05-06
  • 2021-06-09
相关资源
相似解决方案