且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

404 - 请求的资源不可用.(弹簧-mvc)

更新时间:2022-06-13 22:41:39

我可以帮你抓住一些要点,我发现困难的地方

I can help you to catch some points,where I found the difficulty

  1. 在你的 web.xml 中,在 context-param 下配置 servlet-context.xml 的正确路径
  2. 在 servlet-context.xml 下的 context:component-scan base-package="/youcontrollerclass"/- 检查您是否提供了正确的路径
  3. POM.xml 中的依赖文件

这是我的 servlet-context.xml 的一部分

this is part of my servlet-context.xml

    <context:component-scan base-package="mypath"/>

     <bean id="jspViewResolver"
      class="org.springframework.web.servlet.view.InternalResourceViewResolver"
      p:prefix="/WEB-INF/jsp/"
      p:suffix=".jsp" />