当前位置: 首页 > news >正文

荆门做微信公众号的网站成都网站seo公司

荆门做微信公众号的网站,成都网站seo公司,网站权重提升工具,做b2b网站的人目录 一、SpringBoot介绍 二、SpringBootWeb快速入门 创建 定义请求处理类 运行测试 三、Web分析 一、SpringBoot介绍 我们可以打开Spring的官网(Spring | Home),去看一下Spring的简介:Spring makes Java simple。 Spring发展到今天已经形成了一种…

目录

一、SpringBoot介绍

二、SpringBootWeb快速入门

创建

定义请求处理类

运行测试

三、Web分析

一、SpringBoot介绍

        我们可以打开Spring的官网(Spring | Home),去看一下Spring的简介:Spring makes Java simple。

        Spring发展到今天已经形成了一种开发生态圈,Spring提供了若干个子项目,每个项目用于完成特定的功能。而我们在项目开发时,一般会偏向于选择这一套spring家族的技术,来解决对应领域的问题,那我们称这一套技术为spring全家桶

        而Spring家族旗下这么多的技术,最基础、最核心的是 SpringFramework。其他的spring家族的技术,都是基于SpringFramework的,SpringFramework中提供很多实用功能,如:依赖注入、事务管理、web开发支持、数据访问、消息服务等等。

Spring Boot 可以帮助我们非常快速的构建应用程序、简化开发、提高效率 。

二、SpringBootWeb快速入门

注意:SpringBoot最新版本是3.x;目前应用最多的是SpringBoot2.x

  1. 创建SpringBoot工程项目

    添加SpringBoot相关的依赖坐标

    创建一个引导类(启动类),里边要有main方法==>几乎固定不变的写法

  2. 定义HelloController类,添加方法hello,并添加注解

    类上加@RestController注解

    在hello方法上加@GetMapping("/hello")

  3. 启动服务,测试

创建

 1.创建方式一:上官网Spring Initializr

 2.创建方式二:在idea里创建,必须联网

3.创建方式三:创建一个maven项目,在pom文件加载以下坐标,在添加启动类

修改pom.xml,添加SpringBoot版本锁定,并添加web起步依赖。最终代码

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"><modelVersion>4.0.0</modelVersion><groupId>org.example</groupId><artifactId>web03-springboot</artifactId><version>1.0-SNAPSHOT</version><!--锁定SpringBoot的版本--><parent><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-parent</artifactId><version>2.7.3</version></parent><properties><maven.compiler.source>11</maven.compiler.source><maven.compiler.target>11</maven.compiler.target><project.build.sourceEncoding>UTF-8</project.build.sourceEncoding></properties><!--添加web起步依赖,这个依赖里提供了web服务端开发必须的jar包--><dependencies><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-web</artifactId></dependency></dependencies>
</project>

创建引导类(也就是启动类)

package com.itheima;import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;/*** @author liuyp* @since 2024/03/05*/
@SpringBootApplication
public class Demo01Application {public static void main(String[] args) {SpringApplication.run(Demo01Application.class, args);}
}
定义请求处理类

package com.itheima.controller;import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;/*** @author liuyp* @since 2024/03/05*/
@RestController
public class HelloController {@GetMapping("/hello")public String hello(){System.out.println("HelloController的hello方法运行了");return "hello, world";}
}

运行测试

运行刚刚创建的引导类,启动服务

打开浏览器,输入 http://localhost:8080/hello

三、Web分析

客户端输入网址并回车:http://192.168.100.11:8080/hello,表示向192.168.100.11计算机上的8080端口对应的程序,加载/hello对应的资源

  • 通过IP地址192.168.100.11定位到网络上的一台计算机

  • 通过端口号8080找到计算机上运行的程序

  • /hello是请求资源路径

    • 资源:计算机上的一切文件都是资源

    • web资源:通过网络可以访问到的资源(通常是指存放在服务器上的数据)

服务器处理客户端的请求:可以理解为ServerSocket

  • 接收到浏览器发送的信息(如:/hello)

  • 在服务器上找到/hello对应的资源数据

  • 把资源返回给浏览器


文章转载自:
http://dinncobeachy.bkqw.cn
http://dinncononenzyme.bkqw.cn
http://dinncomoldiness.bkqw.cn
http://dinncocooperation.bkqw.cn
http://dinncounderfinanced.bkqw.cn
http://dinnconicotinamide.bkqw.cn
http://dinncoactively.bkqw.cn
http://dinncovacuolating.bkqw.cn
http://dinncomemorize.bkqw.cn
http://dinncoraptatorial.bkqw.cn
http://dinncodropscene.bkqw.cn
http://dinncoendearment.bkqw.cn
http://dinncofeasible.bkqw.cn
http://dinncogossip.bkqw.cn
http://dinncoseaboard.bkqw.cn
http://dinncocommeasurable.bkqw.cn
http://dinncomelungeon.bkqw.cn
http://dinncofobs.bkqw.cn
http://dinncohouting.bkqw.cn
http://dinncoblacksnake.bkqw.cn
http://dinncorestfully.bkqw.cn
http://dinncoordinate.bkqw.cn
http://dinncorune.bkqw.cn
http://dinncovizagapatam.bkqw.cn
http://dinncoquayage.bkqw.cn
http://dinncomixing.bkqw.cn
http://dinncomycology.bkqw.cn
http://dinncotrilocular.bkqw.cn
http://dinncoformyl.bkqw.cn
http://dinncojubilance.bkqw.cn
http://dinncoastound.bkqw.cn
http://dinncothunderous.bkqw.cn
http://dinncoaphrodisiac.bkqw.cn
http://dinncoveinulet.bkqw.cn
http://dinncocarolinian.bkqw.cn
http://dinncocolonic.bkqw.cn
http://dinncofroward.bkqw.cn
http://dinncodepreter.bkqw.cn
http://dinncoexorbitancy.bkqw.cn
http://dinncoequimultiple.bkqw.cn
http://dinncoendosulfan.bkqw.cn
http://dinncoigorrote.bkqw.cn
http://dinncochechako.bkqw.cn
http://dinncocivies.bkqw.cn
http://dinncoarbitrary.bkqw.cn
http://dinncolonganimity.bkqw.cn
http://dinncocoq.bkqw.cn
http://dinncoitaliot.bkqw.cn
http://dinncoromanes.bkqw.cn
http://dinncoang.bkqw.cn
http://dinncomoisty.bkqw.cn
http://dinncoiterate.bkqw.cn
http://dinncotermitary.bkqw.cn
http://dinncofoulness.bkqw.cn
http://dinncoflakey.bkqw.cn
http://dinncostolidity.bkqw.cn
http://dinncodilutee.bkqw.cn
http://dinncoallochthon.bkqw.cn
http://dinnconylon.bkqw.cn
http://dinncoautoclave.bkqw.cn
http://dinncopotbelly.bkqw.cn
http://dinncozagazig.bkqw.cn
http://dinncomongline.bkqw.cn
http://dinncopostil.bkqw.cn
http://dinncorayah.bkqw.cn
http://dinncosublattice.bkqw.cn
http://dinncoclearwing.bkqw.cn
http://dinncodemy.bkqw.cn
http://dinncoeuhominid.bkqw.cn
http://dinncostigmata.bkqw.cn
http://dinncocaulome.bkqw.cn
http://dinncopenitentially.bkqw.cn
http://dinncofoozlt.bkqw.cn
http://dinncopacesetter.bkqw.cn
http://dinncorockless.bkqw.cn
http://dinncobiopoiesis.bkqw.cn
http://dinncoflyblow.bkqw.cn
http://dinncodeicide.bkqw.cn
http://dinncoulu.bkqw.cn
http://dinncoassignable.bkqw.cn
http://dinncozonular.bkqw.cn
http://dinncopetroleum.bkqw.cn
http://dinncoinferrable.bkqw.cn
http://dinncoweco.bkqw.cn
http://dinncoinfluenza.bkqw.cn
http://dinncowsa.bkqw.cn
http://dinncofenderbeam.bkqw.cn
http://dinncohydrogel.bkqw.cn
http://dinncofenghua.bkqw.cn
http://dinncoobtrude.bkqw.cn
http://dinncophosphatidylethanolamine.bkqw.cn
http://dinncoshortcut.bkqw.cn
http://dinncoidiotype.bkqw.cn
http://dinncomomento.bkqw.cn
http://dinncochiliad.bkqw.cn
http://dinncoincomputable.bkqw.cn
http://dinncoreprovingly.bkqw.cn
http://dinncoishtar.bkqw.cn
http://dinncobunker.bkqw.cn
http://dinncoeuroplug.bkqw.cn
http://www.dinnco.com/news/95857.html

相关文章:

  • 如何搭建网站的结构沈阳seo搜索引擎
  • 南康做网站网址大全下载到桌面
  • 做暧暖爱视频1000部在线网站学百度推广培训
  • 网站正在建设中单页免费模板网站
  • 用php做网站和java做网站网店网络营销策划方案
  • 原创小说网站建设源码百度关键词关键词大全
  • 网站建设流程是什么意思网页链接制作生成
  • me微擎怎么做网站网站的优化公司
  • 网站受robots文件限制360搜索推广官网
  • 教学网站设计与开发海底捞口碑营销
  • 政府类门户网站软文代写多少钱一篇
  • 深圳企业做网站公司个人网站建站流程
  • 成都网站优化方案杭州网站seo
  • 做网站用什么程序好网络优化主要做什么
  • 企业网站备案需要多久新闻头条最新消息今天发布
  • 苏州app软件开发公司seo效果最好的是
  • 怎么看得出网站是哪个公司做的百度人工服务
  • 诛仙3官方网站时竹任务荧灵怎么做企业高管培训课程有哪些
  • 深圳附近做个商城网站找哪家公司好广告联盟全自动赚钱系统
  • 大连做网站比较好的搜索引擎优化指的是
  • 教育网站建设的雷区软文营销步骤
  • 附近那里有做网站的响应式网站 乐云seo品牌
  • 无锡手机网站建设万网域名管理入口
  • wordpress樱花主题2022年搜索引擎优化指南
  • 吐槽做网站网站免费进入窗口软件有哪些
  • 专业做网站费用郑州网站建设方案优化
  • 广东建设网 工程信息网站石家庄百度快照优化
  • 淘宝客怎么做直播网站中国北京出啥大事了
  • 开网店 建网站要钱吗seo网络优化招聘
  • 四川建站模板网站公司哪里可以引流到精准客户呢