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>

  • 相关阅读:
    软考相关试题
    qt中的toUtf8, toLatin1, Local8bit, toUcs4(转)
    qt的中文乱码问题
    《左耳听风》-ARTS-打卡记录-第八周
    杂题
    图论
    基础数据结构
    整除
    同余
    常用数学
  • 原文地址:https://www.cnblogs.com/gulingjingguai/p/7689585.html
Copyright © 2011-2022 走看看