Spring configuration file Springtest.xml Transfer location
Look at the Web. config file location
<!--SPRINGMVC configuration- <servlet> <servlet-name>springMVC</servlet-name> < Servlet-class>org.springframework.web.servlet.dispatcherservlet</servlet-class> <!-- You can customize the location and name of the Servlet.xml configuration file by default to the Web-inf directory with the name [<servlet-name>]-servlet.xml, such as spring-servlet.xml-->< init-param><param-name>contextconfiglocation</param-name><!--here <span style= "font-family: Arial, Helvetica, Sans-serif; >param-name</span> name must be <span style= "font-family:arial, Helvetica, Sans-serif;" >contextconfiglocation</span>--><param-value>classpath:springconfig/springtest.xml</ param-value></init-param> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>springmvc</servlet-name><url-pattern>*.spring </url-pattern> </servlet-mapping>
1) The Load-on-startup element flags whether the container loads the servlet at startup (instantiating and invoking its init () method).
2) Its value must be an integer indicating the order in which the servlet should be loaded
2) A value of 0 or greater than 0 o'clock indicates that the container loads and initializes the servlet when the application is started;
3) When the value is less than 0 or unspecified, the container will not load until the servlet is selected.
4) The lower the value of a positive number, the higher the precedence of the servlet, and the more loaded it will be when the app starts.
5) At the same time, the container will be loaded in its own order of choice.
Optional configuration
<!--spring configuration--><!--======================================--><listener> <listenerclass > org.springframework.web.context.ContextLoaderListener </listener-class></listener> <!--Specifies the directory where the spring bean's configuration file resides. Default configuration in Web-inf directory--><context-param> <param-name>contextConfigLocation</param-name> <param-value><span style= "font-family:arial, Helvetica, Sans-serif;" >classpath:springconfig/</span><span style= "font-family: ' Courier New '; line-height:18px; White-space:pre-wrap; " >applicationContext.xml</span></param-value></context-param>
Customizing the spring configuration file location