為什么我的web.xml里面添加了新的配置內(nèi)容,頁面就不能打開了
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5"?
xmlns="http://java.sun.com/xml/ns/javaee"?
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"?
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee?
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
? <!-- spring核心監(jiān)聽器 -->
? <listener>
? <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
? <!-- ctrl+shift+T ?輸入ContextLoaderListener 便可快速查詢其位置 --> ?
? </listener> ?
? <context-param>
? <param-name>contextConfigLocation</param-name>
? <param-value>classpath:applicationContext.xml</param-value>
? </context-param>
??
<!-- struts2框架核心過濾器配置 -->
<filter>
<filter-name>struts</filter-name><!-- 與下面的struts一致 -->
<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>struts</filter-name><!-- 此處可以任意命名,struct是自定義的 -->
<url-pattern>/*</url-pattern>
</filter-mapping>
? <display-name></display-name>
? ??
? <welcome-file-list>
? ? <welcome-file>index.jsp</welcome-file>
? </welcome-file-list>
</web-app>
加了struts ?spring的配置就不行了
2016-11-02
spring配置文件中加載的東西比較多,并且你
這么配置過后,只要一開啟服務器,先讀取web.xml文件,然后讀到這里的時候就會去加載spring的配置文件,如果spring配置文件里有加載數(shù)據(jù)庫的,就要先打開數(shù)據(jù)庫服務,不然項目啟動就會報錯。