Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the springboot embedded and external tomcat startup like

2025-04-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

This article is to share with you about springboot embedded and external tomcat startup is how, the editor feels very practical, so share with you to learn, I hope you can learn something after reading this article, say no more, follow the editor to have a look.

one。 Embedded tomcat

1.

Spring-boot-starter-web has built-in tomcat

Org.springframework.boot spring-boot-starter-web org.springframework.boot spring-boot-starter-tomcat 2.0.3.RELEASE compile

The springboot project starts with an embedded tomcat

1)。

@ SpringBootApplication

2)

SpringApplication.run (TelemarketingUsersynApplication.class, args)

two。 Start with an external tomcat

1. Inherit SpringBootServletInitializer

two。 Override the SpringApplicationBuilder method

@ SpringBootApplication (exclude= {DataSourceAutoConfiguration.class}) public class xxxxxx extends SpringBootServletInitializer {@ Override protected SpringApplicationBuilder configure (SpringApplicationBuilder builder) {return builder.sources (xxxxxx. Class);} public static void main (String [] args) {SpringApplication.run (TelemarketingUsersynApplication.class, args);}}

3. Add external tomcat dependencies

Com.jd.security jd-security-tomcat 1.13.WEBAPP org.apache.tomcat tomcat-jasper 8.0.30 provided org.apache.tomcat tomcat-catalina 8.0.30 provided above is what the springboot embedded and external tomcat startup is like. The editor believes that there are some knowledge points that we may see or use in our daily work. I hope you can learn more from this article. For more details, please follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report