この記事では、主に、Webコンテナにインスタンス化されたスプリングの関連する構成の簡単な紹介について説明します。特定のコンテンツを見てみましょう。
Webコンテナのインスタンス化されたスプリング構成命令:
Webコンテナをインスタンス化するときにスプリングコンテナをロードするには、web.xmlファイルの構成は次のとおりです。
<context-param> <param-name> contextconfiglocation </param-name> <param-value> classpath:bean.xml </param-value> </context-param> <! - リスナーのスプリングコンテナ - > <リスナー> <リスナークラス> org.springframework.web.context.context.context.context.context.context.context
説明:
デフォルトでは、Springがインスタンス化されると、ApplicationContext.xmlは /web-inf /の下にロードされます
<param-name> contextconfiglocation </param-name>
<param-value> classpath:bean.xml </param-value> springをロードする必要があるファイルを指定します(classpathの下のbean.xmlファイル)
構成ファイルに次のように複数の構成がある場合:
<context-param> <param-name> contextconfiglocation </param-name> <param-value> classpath*:conf/spring/applicationcontext_core*.xml、classpath*:conf/spring/applicationcontext_dict*.xml、classpath*:conf/spring/applicationcontext_hibernate.xml classpath*:conf/spring/applicationcontext_security.xml classpath*:conf/spring/applicationcontext_modules*.xml、classpath*:conf/spring/applicationcontext_modules*.xml、classpath*:conf/spring/applicationcontext_modules*.xml classPath*:conf/spring/applicationContext_cti*.xml classpath*:conf/spring/applicationContext_apm*.xml </param-value> </context-Param>
または(次のように分離されたスペースを使用してください:)
<context-param> <param-name> contextconfiglocation </param-name> <param-value> applicationContext-database.xml applicationContext.xml </param-value> </context-param>
要約します
上記は、Webコンテナにスプリング関連の構成解析をインスタンス化することです。私はそれが誰にでも役立つことを願っています。興味のある友達は引き続きこのサイトを参照できます:
「春のインスタンスビーンの方法とコードの詳細な説明」
「 Spring's Instance Factoryメソッドと静的工場法の例コード」
「春のシングルトンビーンとシングルトンパターンの違いに関する簡単な議論」
欠点がある場合は、それを指摘するためにメッセージを残してください。このサイトへのご支援をありがとうございました!