SpringMVC - load-on-startup

简介: SpringMVC - load-on-startup

load-on-startup元素标记容器是否在启动的时候就加载这个servlet(实例化并调用其init()方法)。

它的值必须是一个整数,表示servlet应该被载入的顺序

当值为0或者大于0时,表示容器在应用启动时就加载并初始化这个servlet;

当值小于0或者没有指定时,则表示容器在该servlet被选择时才会去加载。

正数的值越小,该servlet的优先级越高,应用启动时就越先加载。

当值相同时,容器就会自己选择顺序来加载。

所以 <load-on-startup>x</load-on-startup>,中x的取值1,2,3,4,5代表的是优先级,而非启动延迟时间。


目录
相关文章
|
1月前
|
Java
springboot启动报错:“Error starting ApplicationContext. To display the conditions report re-run your appl
springboot启动报错:“Error starting ApplicationContext. To display the conditions report re-run your appl
91 0
|
11月前
|
XML Java 程序员
Spring启动报错--class path resource [Beans.xml] cannot be opened because it does not exist
程序员不是在去生产bug的路上,那就是在去解决bug的路上。🤣🤣🤣🤣
109 1
|
Java 测试技术 Spring
Configuration problem: Failed to import bean definitions from URL location classpath:spring-mvc.xml
Configuration problem: Failed to import bean definitions from URL location classpath:spring-mvc.xml
689 0
Embedded web server initialization - jar file default-mimetypes.properties
Embedded web server initialization - jar file default-mimetypes.properties
104 0
Embedded web server initialization - jar file default-mimetypes.properties
Property 'server.jsp-servlet.init-parameters' is Deprecated: Use 'server.servlet.jsp.init-parameters
版权声明:本文为 testcs_dn(微wx笑) 原创文章,非商用自由转载-保持署名-注明出处,谢谢。 https://blog.csdn.net/testcs_dn/article/details/80897595 Property 'server.
1295 0
|
Java 前端开发
JSP无法加载静态资源:Failed to load resource: the server responded with a status of 404 ()
最近在用前端框架做javaweb开发的时候,总是遇到静态资源无法正常加载的bug,问题如下图 bug 原因是在经过servletDispatcher转发时被它内置的过滤器给拦截了,引入文件是这样的 问题源 解决方法: 1、在...
62699 2
|
Apache Shell
|
Oracle 关系型数据库 Shell