Der Artikel untersucht hauptsächlich die kurze Einführung in die relevante Konfiguration des sofortigen Feders in Webcontainern. Schauen wir uns den spezifischen Inhalt an.
Instanziierte Federkonfigurationsanweisungen im Webcontainer:
So laden Sie den Federcontainer beim Instantieren des Webcontainers, die Konfiguration in der Datei web.xml lautet wie folgt:
<Context-Param> <param-name> contextconfigLocation </param-name> <param-value> classPath: bean.xml </param-value> </context-param> <!-Zuhörer für die Instanzipation von Spring Containern-> <Hörer> <Hörer-Klasse> org.springframework.web.context.contextloaderListener </Listener-Klasse> </Listener>
veranschaulichen:
Standardmäßig wird die ApplicationContext.xml unter /web-inf /geladen, wenn die Spring instanziiert ist.
<Param-name> contextConfigLocation </param-name>
<param-value> classPath: bean.xml </param-value> Gibt die Datei an, die Spring geladen werden muss (Bean.xml-Datei unter dem ClassPath)
Wenn die Konfigurationsdatei wie folgt mehrere Konfigurationen hat:
<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*: concon/applicationContex. 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_modules*.xml CLASSPATH*: conf/spring/applicationContext_cti*.xml classPath*: conf/spring/applicationContext_apm*.xml </param-value> </context-param>
Oder (unter Verwendung von Leerzeichen getrennt, wie folgt :)
<Context-Param> <param-name> contextconfigLocation </param-name> <param-value> applicationContext-database.xml ApplicationContext.xml </param-value> </context-param>
Zusammenfassen
Bei dem oben genannten dreht sich alles um die Instanziierung der Federbezogene Konfiguration an Webcontainern. Ich hoffe, es wird für alle hilfreich sein. Interessierte Freunde können weiterhin auf diese Seite verweisen:
" Detaillierte Erläuterung der Methode und des Code der Spring -Instantiation Bean "
" Instanzfabrikmethode von Spring und Beispiel für statische Fabrikmethode "
" Eine kurze Diskussion über den Unterschied zwischen Spring Singleton Bean und Singleton Muster "
Wenn es Mängel gibt, hinterlassen Sie bitte eine Nachricht, um darauf hinzuweisen. Vielen Dank an Freunde für Ihre Unterstützung für diese Seite!