折燕 2023-02-01 11:27 采纳率: 82.1%
浏览 52
已结题

xml文件配置不对,始终无法访问controller

img

img

img


我的web.xml文件和springmvc.xml以及applicationContext.xml文件配置如上,jsp页面访问controller接口一直报404,不知道是哪里出错了

  • 写回答

1条回答 默认 最新

  • m0_54204465 2023-02-01 12:31
    关注

    一些建议:

    在web.xml文件中, 应该是 org.springframework.web.servlet.DispatcherServlet。

    在 applicationContext.xml 文件中,有一些错误的命名空间。应该为:

    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.springframework.org/schema/beans
                        http://www.springframework.org/schema/beans/spring-beans.xsd
                        http://www.springframework.org/schema/tx
                        http://www.springframework.org/schema/tx/spring-tx.xsd
                        http://www.springframework.org/schema/context
                        http://www.springframework.org/schema/context/spring-context.xsd"
    
    

    检查控制器的 URL 映射是否正确。

    在调试过程中,请检查服务器日志,以了解错误详情。

    评论

报告相同问题?

问题事件

  • 已结题 (查看结题原因) 2月8日
  • 创建了问题 2月1日