福建网站优化建设汕头网站建设方案开发

news/2025/9/30 23:16:12/文章来源:
福建网站优化建设,汕头网站建设方案开发,寻加工厂合作订单,山东百度推广这里我就简单的聊几句#xff0c;如何用vertx web来搞一个web项目的 1、首先先引入几个依赖#xff0c;这里我就用maven了#xff0c;这个是kotlinvertx web ?xml version1.0 encodingUTF-8? project xmlnshttp://maven.apac…这里我就简单的聊几句如何用vertx web来搞一个web项目的 1、首先先引入几个依赖这里我就用maven了这个是kotlinvertx web ?xml version1.0 encodingUTF-8? project xmlnshttp://maven.apache.org/POM/4.0.0xmlns:xsihttp://www.w3.org/2001/XMLSchema-instancexsi:schemaLocationhttp://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsdmodelVersion4.0.0/modelVersiongroupIdorg.example/groupIdartifactIdkotlin-vertx/artifactIdversion1.0-SNAPSHOT/versionpropertiesmaven.compiler.source17/maven.compiler.sourcemaven.compiler.target17/maven.compiler.targetproject.build.sourceEncodingUTF-8/project.build.sourceEncodingkotlin.version1.8.20/kotlin.version/propertiesdependenciesdependencygroupIdio.vertx/groupIdartifactIdvertx-core/artifactId/dependencydependencygroupIdio.vertx/groupIdartifactIdvertx-codegen/artifactId/dependencydependencygroupIdio.vertx/groupIdartifactIdvertx-service-proxy/artifactId/dependencydependencygroupIdio.vertx/groupIdartifactIdvertx-web/artifactId/dependencydependencygroupIdio.vertx/groupIdartifactIdvertx-auth-common/artifactId/dependencydependencygroupIdch.qos.logback/groupIdartifactIdlogback-classic/artifactIdversion1.2.3/version/dependencydependencygroupIdorg.jetbrains.kotlinx/groupIdartifactIdkotlinx-coroutines-core/artifactIdversion1.7.1/version/dependencydependencygroupIdorg.jetbrains.kotlin/groupIdartifactIdkotlin-stdlib-jdk8/artifactIdversion${kotlin.version}/version/dependencydependencygroupIdorg.jetbrains.kotlin/groupIdartifactIdkotlin-test/artifactIdversion${kotlin.version}/versionscopetest/scope/dependency/dependenciesbuildpluginsplugingroupIdorg.jetbrains.kotlin/groupIdartifactIdkotlin-maven-plugin/artifactIdversion${kotlin.version}/versionexecutionsexecutionidcompile/idphasecompile/phasegoalsgoalcompile/goal/goalsconfigurationsourceDirssourcesrc/main/java/sourcesourcetarget/generated-sources/annotations/source/sourceDirs/configuration/executionexecutionidtest-compile/idphasetest-compile/phasegoalsgoaltest-compile/goal/goals/execution/executionsconfigurationjvmTarget${maven.compiler.target}/jvmTarget/configuration/pluginplugingroupIdorg.apache.maven.plugins/groupIdartifactIdmaven-compiler-plugin/artifactIdexecutionsexecutioniddefault-compile/idphasenone/phase/executionexecutioniddefault-testCompile/idphasenone/phase/executionexecutionidcompile/idphasecompile/phasegoalsgoalcompile/goal/goals/executionexecutionidtestCompile/idphasetest-compile/phasegoalsgoaltestCompile/goal/goals/execution/executions/plugin/plugins/builddependencyManagementdependenciesdependencygroupIdio.vertx/groupIdartifactIdvertx-dependencies/artifactIdversion4.4.4/versiontypepom/typescopeimport/scope/dependency/dependencies/dependencyManagement/project 2、先创建一个简单的httpweb package org.example.kotlin_webimport io.vertx.core.AbstractVerticle import io.vertx.core.Vertx import io.vertx.core.http.HttpServerOptions import io.vertx.ext.web.Router import kotlinx.coroutines.delayclass HttpWeb : AbstractVerticle() {override fun start() {var router Router.router(vertx);router.get(/hello).handler { context -context.response().end(Hello World)};vertx.createHttpServer().requestHandler(router).listen(8080)} } fun main(){var vertx Vertx.vertx();vertx.deployVerticle(HttpWeb()) } 这里用了路由也就是说访问localhost:8080/hello  它会输出Hello World这个是get请求 3、get请求带参数 package org.example.kotlin_webimport io.vertx.core.AbstractVerticle import io.vertx.core.Vertx import io.vertx.ext.web.Routerclass HttpWeb : AbstractVerticle() {override fun start() {var router Router.router(vertx);router.get(/hello).handler { ctx -val name: String ctx.request().getParam(name)// 处理逻辑val message Hello, $name!// 返回响应ctx.response().end(message)};vertx.createHttpServer().requestHandler(router).listen(8080)} } fun main(){var vertx Vertx.vertx();vertx.deployVerticle(HttpWeb()) } 可以看到非常简单 4、post请求带参数 package org.example.kotlin_webimport io.vertx.core.AbstractVerticle import io.vertx.core.Vertx import io.vertx.core.buffer.Buffer import io.vertx.ext.web.Router import io.vertx.ext.web.RoutingContext import io.vertx.ext.web.handler.StaticHandlerclass HttpWeb : AbstractVerticle() {override fun start() {var router Router.router(vertx);router.route().handler(StaticHandler.create(src/main/resources/static).setCachingEnabled(false).setDefaultContentEncoding(UTF-8));router.get(/hello).handler { ctx -val name: String ctx.request().getParam(name)// 处理逻辑val message Hello, $name!// 返回响应ctx.response().end(message)};router.post().path(/index).handler { ctx: RoutingContext -val request ctx.request()val response ctx.response()response.putHeader(Content-Type, text/plain; charsetutf-8)val formAttributes request.formAttributes()request.bodyHandler { body: Buffer -val formData body.toString()println(Received form data: $formData)response.setStatusCode(200)response.end(Form submitted successfully)}}vertx.createHttpServer().requestHandler(router).listen(8080)} } fun main(){var vertx Vertx.vertx();vertx.deployVerticle(HttpWeb()) } index.html !DOCTYPE html html langen headmeta charsetUTF-8titleindex/title /head body form methodpost actionhttp://localhost:8080/index姓名: input typetext namename br密码: input typepassword namepassword brinput typesubmit /form /body /html 这里的所有代码都写到了同一个文件里面这样极其的不美观可以优化一下

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/923344.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

利用接口中的静态虚拟成员实现自定义配置节

本文介绍了C# 11中静态虚拟成员接口的新特性,展示了如何利用这一特性简化自定义配置节的注册和使用过程。通过定义IConfigOptions接口和扩展方法,实现了类型安全的配置管理,减少了重复代码。利用接口中的静态虚拟成…

天线增益与有源接收面积之间的关系

最近在看卫星通信,在学习星地链路传输的时候看到以下内容对于频率低于 1 GHz 的频段,使用有源接收面积接收电波时效率提升很困难 频率较低时,波长较长,小口径天线有效接收面积(有效口径)反而较小 有源接收面积 \…

US$54 AM29FXXX Adapter for CG Pro 9S12 Programmer

AM29FXXX Adapter for CG Pro 9S12 ProgrammerAM29FXXX Adapter is used to do AM29F200/AM29F400/AM29F800 series chip for ECU repair, Immobilizer repair etc.If your CG Pro 9S12 is with new design, please ch…

阜阳网站设计贵州普安县建设局网站

事务的特性 ACID 事务的隔离级别 并发事务问题 脏读:一个事务读到另一个事务还没有提交的数据不可重复读:一个事务先后读取同一条记录,但两次读取的数据不同幻读:一个事务按照条件查询数据时,没有对应的数据行&#xf…

2025CSP-S晋级和英才计划入围后:我走过了哪些路

九月就这样在瞬息之间离去,在九月的最后一天里,我开始回忆。 今年的CSP-S1在9月20日,开学后只有三周时间,第二周和第三周的周一二三,学校给我们安排了晚自习第三节课的初赛练题,很显然这是不够的。 在一个信奥弱…

流量分析

流量分析 主要还是对近期遇到的流量题目做一个总结,重在思路总结,方便以后翻阅@_@ 题目:[第九章][9.3.2 webshell混淆流量分析]webshell流量分析 NetA一把梭手搓 wireshark,筛选http->按包的长度(length)排序…

常州网站建设外包手机商场网站制作

📢专注于分享软件测试干货内容,欢迎点赞 👍 收藏 ⭐留言 📝 如有错误敬请指正!📢交流讨论:欢迎加入我们一起学习!📢资源分享:耗时200小时精选的「软件测试」资…

数据表和网站建设的关系个人名片模板

视频汇聚/视频云存储/集中存储/视频监控管理平台EasyCVR能在复杂的网络环境中,将分散的各类视频资源进行统一汇聚、整合、集中管理,实现视频资源的鉴权管理、按需调阅、全网分发、云存储、智能分析等,视频智能分析平台EasyCVR融合性强、开放度…

fdsaf -

Hello World fdafd fdaf function aa(){alert(1) }

【J+S 二十连测】-- 第十二套爆炸记

已成彩笔这都能打炸,为啥我这么菜啊?这都能打炸,为啥我这么菜啊?这都能打炸,为啥我这么菜啊?这都能打炸,为啥我这么菜啊?这都能打炸,为啥我这么菜啊?这都能打炸,为啥我这么菜啊?这都能打炸,为啥我这么菜啊…

2025-2026-1 CS3311 软件工程 个人项目第一版已发布

程序已开源在github 以下是任务清单: 时间单位:h,最小单位0.5计划明确需求:0.5开发分析需求、生成设计文档、设计复审、代码规范:1.5 具体设计:2 具体编码:6 代码复审:1.5 测试:1.5记录用时:0 测试报告:2.5…

Python浅拷贝、深拷贝

浅拷贝和深拷贝是处理复杂数据结构(如列表、字典、对象等)时的两种复制方式,核心区别在于是否复制嵌套的数据结构:1. 浅拷贝(Shallow Copy) 只复制最外层的数据,而嵌套的子对象(如列表中的列表、字典中的列表等…

免费网站开发框架做棋牌网站建设

ob对比其他软件 上文提到obsidian,这里对obsidian做一个简要的总结 优点:对比notion,语雀这些软件,内容存储在应用商的服务器上。它是存在本地的。 对比思源笔记。说一下思源笔记的不足。思源是块来控制的,回车就是一…

RPC在分布式存储系统中的应用 - 指南

pre { white-space: pre !important; word-wrap: normal !important; overflow-x: auto !important; display: block !important; font-family: "Consolas", "Monaco", "Courier New", …

知名的家居行业网站开发南通门户网站建设

前言 云计算带来的优势之一便是弹性能力,云原生场景下Kubernetes提供了水平弹性扩容能力(HPA),让应用可以随着实时指标进行扩/缩。然而HPA的实际工作情况可能和我们直观预想的情况是不一样的,这里面存在一些认知误区。…

US$134 Tango Toyota Key Maker Authorization Service

Tango Toyota Key Maker Authorization ServiceIf you buy Tango Key Programmer Basic Software (SK80), and want to get the Toyota Key Maker Authorization, you can buy this service.Tips: No need shipping, a…

阿里业务身份建模

目录背景和价值一、基础:业务身份抽象——给盒马一个“独立且兼容”的“数字身份证”1. 业务身份的具体定义2. 抽象身份的核心价值:隔离共性与个性案例场景二、核心:流程引擎与双流程模版——线下线上“同路不同程”…

实用指南:矩阵结构体 图片绘制 超级玛丽demo6

实用指南:矩阵结构体 图片绘制 超级玛丽demo6pre { white-space: pre !important; word-wrap: normal !important; overflow-x: auto !important; display: block !important; font-family: "Consolas", &q…

网站百度收录批量查询无锡百姓网推广代理商

UWA Gears 是UWA最新发布的无SDK性能分析工具。针对移动平台,提供了实时监测和截帧分析功能,帮助您精准定位性能热点,提升应用的整体表现。 在上周的文章中,我们详细介绍了网格查看器的功能,介绍如何通过网格数据优化…

C语言实战任务:贪吃蛇(2)

pre { white-space: pre !important; word-wrap: normal !important; overflow-x: auto !important; display: block !important; font-family: "Consolas", "Monaco", "Courier New", …