ssm整合tomcat10
时间: 2023-11-16 11:54:20 浏览: 84
首先需要在pom.xml中添加Tomcat的依赖:
```
<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-core</artifactId>
<version>10.0.0-M9</version>
</dependency>
```
然后在Spring配置文件中配置Tomcat:
```
<bean id="tomcat" class="org.apache.catalina.startup.Tomcat">
<property name="port" value="8080" />
<property name="baseDir" value="target/tomcat" />
<property name="addContextLifecycleListeners" value="true" />
</bean>
<bean id="servletContainer" class="org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory">
<property name="tomcat" ref="tomcat" />
</bean>
```
阅读全文