strutsとspringプロファイルのロード
1156 ワード
1.struts 2フレームワークは、WEB-INF/classesパスの下にあるstrutsを自動的にロードする.xmlファイル
またはconfigパラメータを使用して構成します
2.Springは、WebアプリケーションのListenerとして使用するContextLoaderListenerクラスを提供し、Webアプリケーションの起動時に、WEB-INF/下のアプリケーションContextを検索することを問い合わせる.ximlプロファイル、またはcontextConfigLocationパラメータを使用して構成
またはconfigパラメータを使用して構成します
<filter>
<filter-name>struts2</filter-name>
<filter-class>
org.apache.struts2.dispatcher.FilterDispatcher
</filter-class>
<init-param>
<param-name>config</param-name>
<param-value>
struts-default.xml, ../conf/struts.xml
</param-value>
</init-param>
</filter>
2.Springは、WebアプリケーションのListenerとして使用するContextLoaderListenerクラスを提供し、Webアプリケーションの起動時に、WEB-INF/下のアプリケーションContextを検索することを問い合わせる.ximlプロファイル、またはcontextConfigLocationパラメータを使用して構成
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/applicationContext.xml</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>