spring task 为什么会执行多次
发布网友
发布时间:2024-01-13 23:23
我来回答
共1个回答
热心网友
时间:2024-12-04 15:51
<!--全局Servlet调度配置 -->
<servlet>
<!--若设置 servlet-name为[name] -->
<!--则DispatcherServlet在实例化后会自动加载[name]-servlet.xml -->
<servlet-name>spring</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:servletContext.xml</param-value>
</init-param>
<!--随服务器一同启动 -->
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>spring</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>