首页
归档
留言
友链
广告合作
壁纸
更多
美女主播
Search
1
博瑞GE车机升级/降级
5,610 阅读
2
Mac打印机设置黑白打印
4,949 阅读
3
修改elementUI中el-table树形结构图标
4,895 阅读
4
Mac客户端添加腾讯企业邮箱方法
4,674 阅读
5
intelliJ Idea 2022.2.X破解
4,357 阅读
后端开发
HarmonyOS Next
Web前端
微信开发
开发辅助
App开发
数据库
随笔日记
登录
/
注册
Search
标签搜索
Spring Boot
Java
Vue
Spring Cloud
Mac
MyBatis
WordPress
MacOS
asp.net
Element UI
Nacos
.Net
Spring Cloud Alibaba
MySQL
Mybatis-Plus
Typecho
jQuery
Java Script
IntelliJ IDEA
微信小程序
Laughing
累计撰写
627
篇文章
累计收到
1,421
条评论
首页
栏目
后端开发
HarmonyOS Next
Web前端
微信开发
开发辅助
App开发
数据库
随笔日记
页面
归档
留言
友链
广告合作
壁纸
美女主播
搜索到
5
篇与
的结果
2025-03-21
Springboot中使用Undertow替换默认的Tomcat容器
{mtitle title="Undertow介绍"/}Undertow是由JBoss(现为Red Hat)开发的一款轻量级、高性能的Web服务器。它是WildFly应用服务器的默认Web容器,专注于高并发和低延迟的场景。Undertow基于NIO(非阻塞I/O)构建,支持HTTP/1.x、HTTP/2和WebSocket协议。{mtitle title="Undertow优势"/}Tomcat凭借其稳定性、易用性和社区支持成为Springboot默认的容器。虽然Tomcat表现足够优秀,但是Undertow也有其可圈可点的地方。高并发支持:Undertow基于NIO构建,能够高效处理大量并发请求,适合高负载场景。低延迟:由于其非阻塞的设计,Undertow在低延迟场景中表现优异。轻量级:Undertow的核心代码非常精简,启动速度快,资源占用低。在资源有限的情况下,尤其是内存和CPU资源紧张的情况下,Undertow是更好的选择。{mtitle title="Undertow替换Tomcat"/}上面介绍了Undertow的优点,那么我们如何在Springboot项目中使用Undertow作为默认容器呢。先来看一下,默认Tomcat容器,启动成功后控制台输出信息为了使用Undertow容器,我们需要修改项目的pom.xml文件,排除掉Tomcat。 <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> <exclusions> <exclusion> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-tomcat</artifactId> </exclusion> </exclusions> </dependency>然后添加Undertow的依赖 <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-undertow</artifactId> </dependency>然后重启项目,查看控制台输出
2025年03月21日
96 阅读
0 评论
0 点赞
2021-11-14
Spring Boot使用Jetty或Undertow替换默认的Tomcat嵌入式容器
Spring Boot切换嵌入式容器的方式非常简单,只需两步,第一步排除Tomcat依赖,第二步,添加Jetty或者Undertow依赖。排除默认的Tomcat依赖<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> <exclusions> <!--排除Tomcat--> <exclusion> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-tomcat</artifactId> </exclusion> </exclusions> </dependency> 添加Jetty依赖如果使用Jetty作为嵌入式容器,我们添加如下依赖。<!--添加Jetty依赖--> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-jetty</artifactId> </dependency>添加Undertow依赖如果使用Undertow作为嵌入式容器,我们可以添加如下依赖<!--添加Undertow依赖--> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-undertow</artifactId> </dependency>
2021年11月14日
986 阅读
0 评论
0 点赞
2019-07-10
修改tomcat配置映射去掉URL中的项目名
Tomcat文件目录conf/server.xml:host节点下添加<Context path="" docBase="projectname" debug="0" reloadable="true"/> 注意:在项目部署了以后在修改,修改了以后重启tomcat,修改了以后会影响到tomcat的控制台页面的运行 <Host name="localhost" appBase="webapps" unpackWARs="true" autoDeploy="true" xmlValidation="false" xmlNamespaceAware="false"> <Context path="" docBase="projectname" debug="0" reloadable="true"/> </host>
2019年07月10日
1,276 阅读
0 评论
0 点赞
2018-04-01
Tomcat配置多个域名
Java最常实用的服务软件应该就是Tomcat了,前段时间也说过,赶在腾讯云搞活动的时间,把dotnetcore.com.cn、ide.net.cn还有lisen.cc几个域名也一起备案了。最近想着用Java新建一个网站。Tomcat配置多个域名还是很简单的,仍然是通过server.xml进行配置。<!--lisen.cc配置--> <Host name="lisen.cc" appBase="webapps" unpackWARs="true" autoDeploy="true"> <!-- SingleSignOn valve, share authentication between web applications Documentation at: /docs/config/valve.html --> <!-- <Valve className="org.apache.catalina.authenticator.SingleSignOn" /> --> <Context docBase="LiSen" path="" /> <!-- Access log processes all example. Documentation at: /docs/config/valve.html Note: The pattern used is equivalent to using pattern="common" --> <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs" prefix="localhost_access_log" suffix=".txt" pattern="%h %l %u %t "%r" %s %b" /> </Host> <!--dotnetcore配置--> <Host name="dotnetcore.com.cn" appBase="webapps" unpackWARs="true" autoDeploy="true"> <Context docBase="DotNetCore" path="" /> <!-- Access log processes all example. Documentation at: /docs/config/valve.html Note: The pattern used is equivalent to using pattern="common" --> <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs" prefix="localhost_access_log" suffix=".txt" pattern="%h %l %u %t "%r" %s %b" /> </Host>
2018年04月01日
1,085 阅读
0 评论
0 点赞
2017-11-07
Mac安装Tomcat
下载Tomcat去Tomcat官网下载最新版本的Tomcat,下载tar格式的即可。加压之后,放到一个目录。授权文件打开终端,输入以下命令sudo chmod 755 /Users/lisen/apache-tomcat-8.5.23/bin/*.sh回车后,输入密码,然后回车启动Tomcat输入以下命令,进入Tomcat的bin目录cd /Users/lisen/apache-tomcat-8.5.23/bin输入以下命令,启动Tomcatsudo sh startup.sh停止Tomcat输入以下命令,停止Tomcatsudo sh shutdown.sh测试Tomcat是否启动Tomcat默认的端口是8080,我们可以输入localhost:8080
2017年11月07日
1,258 阅读
0 评论
1 点赞