zoukankan      html  css  js  c++  java
  • ssm项目,web容器无法初始化项目

    在web.xml中配置加载spring时,发现项目无法运行;而去掉spring的配置时,项目可以被初始化。

    此时应考虑到spring的配置文件中存在错误,以至于web容器无法对项目成功初始化,在web.xml中配置log4j,

    根据打印的信息对spring的配置进行修改。

    <context-param>
    <param-name>log4jConfigLocation</param-name>
    <param-value>classpath:log4j.properties</param-value>
    </context-param>
    <listener>
    <listener-class>org.springframework.web.util.Log4jConfigListener</listener-class>
    </listener>

    <!-- 加载spring容器 -->

    <context-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>classpath:spring/applicationContext-*.xml</param-value>
    </context-param>
    <listener>
    <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
    </listener>


    <servlet>
    <servlet-name>ssm-test-3</servlet-name>
    <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
    <init-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>classpath:spring/springmvc.xml</param-value>
    </init-param>
    </servlet>

    <servlet-mapping>
    <servlet-name>ssm-test-3</servlet-name>
    <url-pattern>*.action</url-pattern>
    </servlet-mapping>

  • 相关阅读:
    C#的4个基本技巧
    如何使用 Visual C# 加密和解密文件
    C#中的反射
    C#集成FastDFS断点续传
    NETCORE TimeJob定时任务的使用
    C#使用ActiveMQ实例
    hadoop+hbase适合存储海量小图片吗?
    windows环境下elasticsearch安装教程(超详细)
    C#:C#调用WebService
    .NETCore远程调用
  • 原文地址:https://www.cnblogs.com/gulingjingguai/p/7689585.html
Copyright © 2011-2022 走看看