Red de conocimiento informático - Problemas con los teléfonos móviles - Cómo escribir web.xml en primavera

Cómo escribir web.xml en primavera

Spring tiene tres métodos de inicio, utilizando ContextLoaderServlet, ContextLoaderListener y ContextLoaderPlugIn

ContextLoaderServlet y Log4jConfigServlet se han eliminado en Spring 3.0 y versiones posteriores. y Log4jConfigServlet

ContextLoaderListener y ContextLoaderPlugIn se pueden usar como los dos métodos de inicio restantes

Se recomienda usar ContextLoaderListener

N0: 1

lt ;! springframework.web.context.ContextLoaderListener

lt; classgt;

N0: 1

lt;! clase-oyentegt;

lt;/listenergt;?

lt;! El valor predeterminado de --contextConfigLocation en la clase ContextLoaderListener es?/WEB-INF/applicationContext.xml--gt;

lt;context-paramgt;

lt;param-namegt ;contextConfigLocationlt ;/param-namegt;

lt;param-valuegt;/WEB-INF/applicationContext.xmllt;/param-valuegt;

lt;! --?lt;param-valuegt;classpath:applicationContext*.xmllt;/param-valuegt;?--gt;

lt;/context-paramgt;

N0: 2 ?lt;! --Ya no se admite después de la primavera 3.0--gt;

lt;servletgt;

lt;servlet-namegt;contextlt;/servlet-namegt;

lt;servlet-classgt;org.springframen0:2N0:2?gt;org.springframework.web.context.ContextLoaderServletlt;/servlet-classgt;

lt;load-on-startupgt;1lt;/ cargar -al iniciar gt;

lt;/servletgt;--gt;

N0: 3

lt;! --Para importar el paquete org.springframework.web.struts-3.0.5.RELEASE.jar, struts 2.0 y versiones posteriores no admiten esta forma de cargar spring--gt

lt; en ?className="org.springframework.web.struts-3.0.5.RELEASE.jar".

springframework.web.struts.ContextLoaderPlugIn"gt; lt; set-property?property="contextConfigLocation"?value="/WEB-INF/ applicationContext.xml"/gt; lt;/plug-ingt;lt;¿Plug-in?