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

How to configure springboot with external tomcat for idea

2025-03-15 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

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

This article introduces the knowledge of "how idea uses external tomcat to configure springboot". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

Create a maven project

Import springboot dependencies and pay attention to the comments below

4.0.0 com.znsd.springboot springboot-jsp 1.0-SNAPSHOT war org.springframework.boot spring-boot-starter-parent 2.3.12.RELEASE org.springframework.boot spring-boot-starter-web org.springframework.boot Spring-boot-starter-tomcat provided org.springframework.boot spring-boot-starter-test test org.junit.vintage junit-vintage-engine Org.springframework.boot spring-boot-maven-plugin

Complete the following operation and save it.

Configure the tomcat startup item

Configure the view parser

Create a springboot main program

@ SpringBootApplicationpublic class SpringBootMain {public static void main (String [] args) {SpringApplication.run (SpringBootMain.class,args);}}

You must write a subclass of SpringBootServletInitializer and call the fixed writing method in the configure method

Public class ServletInitializer extends SpringBootServletInitializer {@ Override protected SpringApplicationBuilder configure (SpringApplicationBuilder application) {/ / the main program of SpringBoot, return application.sources (SpringBootMain.class);}}

Then start tomcat, the console outputs spring, and it starts successfully.

This is the end of the introduction to "how idea uses external tomcat to configure springboot". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

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

Development

Wechat

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

12
Report