idea怎么使用外置tomcat配置springboot-创新互联

本篇内容介绍了“idea怎么使用外置tomcat配置springboot”的有关知识,在实际案例的操作过程中,不少人都会遇到这样的困境,接下来就让小编带领大家学习一下如何处理这些情况吧!希望大家仔细阅读,能够学有所成!

创新互联公司坚持“要么做到,要么别承诺”的工作理念,服务领域包括:成都网站设计、成都网站制作、企业官网、英文网站、手机端网站、网站推广等服务,满足客户于互联网时代的蕉城网站设计、移动媒体设计的需求,帮助企业找到有效的互联网解决方案。努力成为您成熟可靠的网络建设合作伙伴!
  •  创建一个maven项目

  • 导入springboot依赖,注意底下注释部分



    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
            
        
    

idea怎么使用外置tomcat配置springboot

idea怎么使用外置tomcat配置springboot

完成下图操作保存即可


idea怎么使用外置tomcat配置springboot

配置tomcat启动项

idea怎么使用外置tomcat配置springboot

idea怎么使用外置tomcat配置springboot

idea怎么使用外置tomcat配置springboot

idea怎么使用外置tomcat配置springboot

配置视图解析器


idea怎么使用外置tomcat配置springboot

创建一个springboot主程序

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

必须编写一个SpringBootServletInitializer的子类,并调用configure方法里面的固定写法

public class ServletInitializer extends SpringBootServletInitializer {
    @Override
    protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
        //传入SpringBoot的主程序,
        return application.sources(SpringBootMain.class);
    }
}

然后启动tomcat,控制台输出了spring就启动成功了

idea怎么使用外置tomcat配置springboot

“idea怎么使用外置tomcat配置springboot”的内容就介绍到这里了,感谢大家的阅读。如果想了解更多行业相关的知识可以关注创新互联网站,小编将为大家输出更多高质量的实用文章!


网站题目:idea怎么使用外置tomcat配置springboot-创新互联
文章地址:http://hxwzsj.com/article/ddpdgi.html

其他资讯

Copyright © 2025 青羊区翔捷宏鑫字牌设计制作工作室(个体工商户) All Rights Reserved 蜀ICP备2025123194号-14
友情链接: 成都企业网站建设公司 广安网站设计 网站设计制作报价 成都品牌网站建设 重庆外贸网站建设 温江网站设计 成都网站建设 网站建设 成都定制网站建设 自适应网站设计 网站制作 营销型网站建设 成都网站制作 企业手机网站建设 H5网站制作 重庆网站建设 成都网站建设 高端网站设计 成都网站建设 手机网站制作 成都响应式网站建设 响应式网站建设