SpringBoot之Web开发

SpringBoot资料合集-04【Spring Boot与Web开发】 1.SpringMVC快速使用 1.基于restful http接口 的CURD 2.调用rest http接口 3.通过postman调用 4.通过swagger调用 2.SpringMVC自动配置原理分析 3.定制SpringMvc的自动配置 1.通过WebMvcConfigurer进行扩展 2. Json 开发 3.国际化 4.统一异常处理 4.SpringBoot的嵌入式Servlet容器 1.嵌入式Servlet容器配置修改 2.注册servlet三大组件 3.切换其他嵌入式Servlet容器 4 阅读详情

1、简介

使用SpringBoot;

1)、创建SpringBoot应用,选中我们需要的模块;

2)、SpringBoot已经默认将这些场景配置好了,只需要在配置文件中指定少量配置就可以运行起来

3)、自己编写业务代码;

自动配置原理?

这个场景SpringBoot帮我们配置了什么?能不能修改?能修改哪些配置?能不能扩展?xxx

xxxxAutoConfiguration:帮我们给容器中自动配置组件;
xxxxProperties: 配置类来封装配置文件的内容;

2、SpringBoot对静态资源的映射规则;

@ConfigurationProperties(prefix = "spring.resources", ignoreUnknownFields = false)
public class ResourceProperties implements ResourceLoaderAware {
//可以设置和静态资源有关的参数,缓存时间等
WebMvcAuotConfiguration:
    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        if (!this.resourceProperties.isAddMappings()) {
            logger.debug("Default resource handling disabled");
            return;
        }
        Integer cachePeriod = this.resourceProperties.getCachePeriod();
        if (!registry.hasMappingForPattern("/webjars/**")) {
            customizeResourceHandlerRegistration(
                    registry.addResourceHandler("/webjars/**")
                            .addResourceLocations(
                                    "classpath:/META-INF/resources/webjars/")
                    .setCachePeriod(cachePeriod));
        }
        String staticPathPattern = this.mvcProperties.getStaticPathPattern();
        //静态资源文件夹映射
        if (!registry.hasMappingForPattern(staticPathPattern)) {
            customizeResourceHandlerRegistration(
                    registry.addResourceHandler(staticPathPattern)
                            .addResourceLocations(
                                    this.resourceProperties.getStaticLocations())
                    .setCachePeriod(cachePeriod));
        }
    }

    //配置欢迎页映射
    @Bean
    public WelcomePageHandlerMapping welcomePageHandlerMapping(
            ResourceProperties resourceProperties) {
        return new WelcomePageHandlerMapping(resourceProperties.getWelcomePage(),
                this.mvcProperties.getStaticPathPattern());
    }

    //配置喜欢的图标
    @Configuration
    @ConditionalOnProperty(value = "spring.mvc.favicon.enabled", matchIfMissing = true)
    public static class FaviconConfiguration {

        private final ResourceProperties resourceProperties;

        public FaviconConfiguration(ResourceProperties resourceProperties) {
            this.resourceProperties = resourceProperties;
        }

        @Bean
        public SimpleUrlHandlerMapping faviconHandlerMapping() {
            SimpleUrlHandlerMapping mapping = new SimpleUrlHandlerMapping();
            mapping.setOrder(Ordered.HIGHEST_PRECEDENCE + 1);
                //所有  **/favicon.ico 
            mapping.setUrlMap(Collections.singletonMap("**/favicon.ico",
                    faviconRequestHandler()));
            return mapping;
        }

        @Bean
        public ResourceHttpRequestHandler faviconRequestHandler() {
            ResourceHttpRequestHandler requestHandler = new ResourceHttpRequestHandler();
            requestHandler
                    .setLocations(this.resourceProperties.getFaviconLocations());
            return requestHandler;
        }
    }

1)、所有 /webjars/** ,都去 classpath:/META-INF/resources/webjars/ 找资源

webjars:以jar包的方式引入静态资源;

官网:http://www.webjars.org/

<!--引入jquery-webjar-->在访问的时候只需要写webjars下面资源的名称即可
<dependency>
    <groupId>org.webjars</groupId>
    <artifactId>jquery</artifactId>
    <version>3.3.1</version>
</dependency>

这里写图片描述
访问:localhost:8080/webjars/jquery/3.3.1/jquery.js

2)、”/**” 访问当前项目的任何资源,都去(静态资源的文件夹)找映射

"classpath:/META-INF/resources/", 
"classpath:/resources/",
"classpath:/static/", 
"classpath:/public/" 
"/":当前项目的根路径

访问:localhost:8080/abc === 去静态资源文件夹里面找abc

3)、欢迎页; 静态资源文件夹下的所有index.html页面;被”/**”映射

localhost:8080/   找index页面

4)、所有的 **/favicon.ico 都是在静态资源文件下找

3、模板引擎

JSP、Velocity、Freemarker、Thymeleaf
这里写图片描述
SpringBoot推荐的Thymeleaf;

语法更简单,功能更强大;

1、引入thymeleaf

切换thymeleaf版本
<properties>
    <thymeleaf.version>3.0.9.RELEASE</thymeleaf.version>
    <!-- 布局功能的支持程序  thymeleaf3主程序  layout2以上版本 -->
    <!-- thymeleaf2   layout1-->
    <thymeleaf-layout-dialect.version>2.2.2</thymeleaf-layout-dialect.version>
</properties>
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-thymeleaf</artifactId>
    <!--默认2.1.6-->
</dependency>

2、Thymeleaf使用

@ConfigurationProperties(prefix = "spring.thymeleaf")
public class ThymeleafProperties {

    private static final Charset DEFAULT_ENCODING = Charset.forName("UTF-8");

    private static final MimeType DEFAULT_CONTENT_TYPE = MimeType.valueOf("text/html");

    public static final String DEFAULT_PREFIX = "classpath:/templates/";

    public static final String DEFAULT_SUFFIX = ".html";

只要我们把HTML页面放在classpath:/templates/,thymeleaf就能自动渲染;

使用:

1、导入thymeleaf的名称空间

<html lang="en" xmlns:th="http://www.thymeleaf.org">

2、使用thymeleaf语法

<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
    <h1>成功!</h1>
    <!--th:text 将div里面的文本内容设置为 -->
    <div th:text="${hello}">这是显示欢迎信息</div>
</body>
</html>

3、语法规则

1)、th:text;改变当前元素里面的文本内容;

th:任意html属性;来替换原生属性的值

这里写图片描述
2)、表达式

Simple expressions:(表达式语法)
    Variable Expressions: ${...}:获取变量值;OGNL;
            1)、获取对象的属性、调用方法
            2)、使用内置的基本对象:
                #ctx : the context object.
                #vars: the context variables.
                #locale : the context locale.
                #request : (only in Web Contexts) the HttpServletRequest object.
                #response : (only in Web Contexts) the HttpServletResponse object.
                #session : (only in Web Contexts) the HttpSession object.
                #servletContext : (only in Web Contexts) the ServletContext object.

                ${session.foo}
            3)、内置的一些工具对象:
#execInfo : information about the template being processed.
#messages : methods for obtaining externalized messages inside variables expressions, in the same way as they would be obtained using #{…} syntax.
#uris : methods for escaping parts of URLs/URIs
#conversions : methods for executing the configured conversion service (if any).
#dates : methods for java.util.Date objects: formatting, component extraction, etc.
#calendars : analogous to #dates , but for java.util.Calendar objects.
#numbers : methods for formatting numeric objects.
#strings : methods for String objects: contains, startsWith, prepending/appending, etc.
#objects : methods for objects in general.
#bools : methods for boolean evaluation.
#arrays : methods for arrays.
#lists : methods for lists.
#sets : methods for sets.
#maps : methods for maps.
#aggregates : methods for creating aggregates on arrays or collections.
#ids : methods for dealing with id attributes that might be repeated (for example, as a result of an iteration).

    Selection Variable Expressions: *{...}:选择表达式:和${}在功能上是一样;
        补充:配合 th:object="${session.user}:
    <div th:object="${session.user}">
    <p>Name: <span th:text="*{firstName}">Sebastian</span>.</p>
    <p>Surname: <span th:text="*{lastName}">Pepper</span>.</p>
    <p>Nationality: <span th:text="*{nationality}">Saturn</span>.</p>
    </div>

    Message Expressions: #{...}:获取国际化内容
    Link URL Expressions: @{...}:定义URL;
            @{/order/process(execId=${execId},execType='FAST')}
    Fragment Expressions: ~{...}:片段引用表达式
            <div th:insert="~{commons :: main}">...</div>

Literals(字面量)
      Text literals: 'one text' , 'Another one!' ,…
      Number literals: 0 , 34 , 3.0 , 12.3 ,…
      Boolean literals: true , false
      Null literal: null
      Literal tokens: one , sometext , main ,…
Text operations:(文本操作)
    String concatenation: +
    Literal substitutions: |The name is ${name}|
Arithmetic operations:(数学运算)
    Binary operators: + , - , * , / , %
    Minus sign (unary operator): -
Boolean operations:(布尔运算)
    Binary operators: and , or
    Boolean negation (unary operator): ! , not
Comparisons and equality:(比较运算)
    Comparators: > , < , >= , <= ( gt , lt , ge , le )
    Equality operators: == , != ( eq , ne )
Conditional operators:条件运算(三元运算符)
    If-then: (if) ? (then)
    If-then-else: (if) ? (then) : (else)
    Default: (value) ?: (defaultvalue)
Special tokens:
    No-Operation: _ 

更多详情参考官方文档:《Tymeleaf文档》

4、SpringMVC自动配置

https://docs.spring.io/spring-boot/docs/1.5.10.RELEASE/reference/htmlsingle/#boot-features-developing-web-applications

1、Spring MVC auto-configuration

Spring Boot 自动配置好了SpringMVC

以下是SpringBoot对SpringMVC的默认配置:(WebMvcAutoConfiguration)

  • Inclusion of ContentNegotiatingViewResolver and BeanNameViewResolver beans.
    • 自动配置了ViewResolver(视图解析器:根据方法的返回值得到视图对象(View),视图对象决定如何渲染(转发?重定向?))
    • ContentNegotiatingViewResolver:组合所有的视图解析器的;
    • ==如何定制:我们可以自己给容器中添加一个视图解析器;自动的将其组合进来;==
  • Support for serving static resources, including support for WebJars (see below).静态资源文件夹路径,webjars
  • Static index.html support. 静态首页访问
  • Custom Favicon support (see below). favicon.ico

  • 自动注册了 of Converter, GenericConverter, Formatter beans.

    • Converter:转换器; public String hello(User user):类型转换使用Converter
    • Formatter 格式化器; 2017.12.17===Date;
      自己添加的格式化器转换器,我们只需要放在容器中即可
  • Support for HttpMessageConverters (see below).

    • HttpMessageConverter:SpringMVC用来转换Http请求和响应的;User—Json;
    • HttpMessageConverters 是从容器中确定;获取所有的HttpMessageConverter;
      自己给容器中添加HttpMessageConverter,只需要将自己的组件注册容器中(@Bean,@Component)
  • Automatic registration of MessageCodesResolver (see below).定义错误代码生成规则

  • Automatic use of a ConfigurableWebBindingInitializer bean (see below).
    我们可以配置一个ConfigurableWebBindingInitializer来替换默认的;(添加到容器)

org.springframework.boot.autoconfigure.web:web的所有自动场景;

If you want to keep Spring Boot MVC features, and you just want to add additional MVC configuration (interceptors, formatters, view controllers etc.) you can add your own @Configuration class of type WebMvcConfigurerAdapter, but without @EnableWebMvc. If you wish to provide custom instances of RequestMappingHandlerMapping, RequestMappingHandlerAdapter or ExceptionHandlerExceptionResolver you can declare a WebMvcRegistrationsAdapter instance providing such components.

If you want to take complete control of Spring MVC, you can add your own @Configuration annotated with @EnableWebMvc.

2、扩展SpringMVC

a、xml配置:

<mvc:view-controller path="/hello" view-name="success"/>
<mvc:interceptors>
    <mvc:interceptor>
        <mvc:mapping path="/hello"/>
        <bean></bean>
    </mvc:interceptor>
</mvc:interceptors>

b、编写一个配置类(@Configuration),是WebMvcConfigurerAdapter类型;不能标注@EnableWebMvc
既保留了所有的自动配置,也能用我们扩展的配置;

// 使用WebMvcConfigurerAdapter可以来扩展SpringMVC的功能
@Configuration
public class MyMvcConfig extends WebMvcConfigurerAdapter {
    @Override
    public void addViewControllers(ViewControllerRegistry registry) {
        //浏览器发送 /success 请求来到 success
        registry.addViewController("/atguigu").setViewName("success");
    }
}

原理:

1)、WebMvcAutoConfiguration是SpringMVC的自动配置类

2)、在做其他自动配置时会导入;@Import(EnableWebMvcConfiguration.class)

@Configuration
public static class EnableWebMvcConfiguration extends DelegatingWebMvcConfiguration {
  private final WebMvcConfigurerComposite configurers = new WebMvcConfigurerComposite();

//从容器中获取所有的WebMvcConfigurer
  @Autowired(required = false)
  public void setConfigurers(List<WebMvcConfigurer> configurers) {
      if (!CollectionUtils.isEmpty(configurers)) {
          this.configurers.addWebMvcConfigurers(configurers);
            //一个参考实现;将所有的WebMvcConfigurer相关配置都来一起调用;  
            @Override
         // public void addViewControllers(ViewControllerRegistry registry) {
          //    for (WebMvcConfigurer delegate : this.delegates) {
           //       delegate.addViewControllers(registry);
           //   }
          }
      }
}

3)、容器中所有的WebMvcConfigurer都会一起起作用;

4)、我们的配置类也会被调用;

效果:SpringMVC的自动配置和我们的扩展配置都会起作用;

3、全面接管SpringMVC;

SpringBoot对SpringMVC的自动配置不需要了,所有都是我们自己配置;所有的SpringMVC的自动配置都失效了

我们需要在配置类中添加@EnableWebMvc即可;

//使用WebMvcConfigurerAdapter可以来扩展SpringMVC的功能
@EnableWebMvc   // 在自己定义的配置类上配置这个注解,就是所有的SpringMVC的自动配置都失效了
@Configuration
public class MyMvcConfig extends WebMvcConfigurerAdapter {
    @Override
    public void addViewControllers(ViewControllerRegistry registry) {
       // super.addViewControllers(registry);
        //浏览器发送 /atguigu 请求来到 success
        registry.addViewController("/success").setViewName("success");
    }
}

原理:

为什么@EnableWebMvc自动配置就失效了;

1)@EnableWebMvc的核心

@Import(DelegatingWebMvcConfiguration.class)
public @interface EnableWebMvc {

2)、

@Configuration
public class DelegatingWebMvcConfiguration extends WebMvcConfigurationSupport {

3)、

@Configuration
@ConditionalOnWebApplication
@ConditionalOnClass({ Servlet.class, DispatcherServlet.class,
        WebMvcConfigurerAdapter.class })
// 容器中没有这个组件的时候,这个自动配置类才生效
@ConditionalOnMissingBean(WebMvcConfigurationSupport.class)
@AutoConfigureOrder(Ordered.HIGHEST_PRECEDENCE + 10)
@AutoConfigureAfter({ DispatcherServletAutoConfiguration.class,
        ValidationAutoConfiguration.class })
public class WebMvcAutoConfiguration {

4)、@EnableWebMvc将WebMvcConfigurationSupport组件导入进来;

5)、导入的WebMvcConfigurationSupport只是SpringMVC最基本的功能;

5、如何修改SpringBoot的默认配置

模式:

1)、SpringBoot在自动配置很多组件的时候,先看容器中有没有用户自己配置的(@Bean、@Component)如果有就用用户配置的,如果没有,才自动配置;如果有些组件可以有多个(ViewResolver)将用户配置的和自己默认的组合起来;

2)、在SpringBoot中会有非常多的xxxConfigurer帮助我们进行扩展配置

3)、在SpringBoot中会有很多的xxxCustomizer帮助我们进行定制配置

FPGA实战:手写可配置SPI主机控制器,搞定多外设时序 SPI作为嵌入式系统中应用最广泛的同步串行接口之一,凭借其极简的引脚定义和灵活的传输模式,成为MCU与FPGA开发者必须掌握的基础通信协议。其本质是一种由主机产生时钟并控制数据传输的同步机制,通过CPOL和CPHA的组合可以适配不同外设的采样要求。在FPGA开发中,理解SPI的工作原理能帮助工程师摆脱对IP核的依赖,实现高度定制化的时序控制。使用Verilog设计SPI主机控制器,涉及分频、状态机、边沿检测等核心数字逻辑方法,这些技能同样适用于UART和IIC等其他接口。手写SPI模块不仅能够精确匹配NOR 阅读详情

相关推荐

【Spring Boot】Web开发 — Web开发简介

Spring Boot自带的spring-boot-starter-web组件为Web应用开发提供支持,它内嵌的Tomcat以及Spring MVC的依赖使用起来非常方便。Spring Boot创建Web应用非常简单,先创建一个普通的Spring Boot项目,然后修改pom.xml文件将spring-boot-starter-web组件加入项目就可以创建Web应用。我们使用IDEA编辑器打开新创建的Web项目。

衍生星球的博客 3545

Spring MVC : ResourceHttpRequestHandler

概述 ResourceHttpRequestHandler是一个HttpRequestHandler实现类,用于处理静态资源请求。 配置例子 : @Configuration public class WebMvcConfig implements WebMvcConfigurer { /** * 静态资源文件映射配置 * @param registry *...

Details Inside Spring 1万+

高速DAC时钟与配置实战:DAC5681Z硬件设计与寄存器编程详解

在高速数据转换系统中,时钟信号是决定系统性能的核心要素,其稳定性和纯净度直接影响数模转换器(DAC)的输出频谱纯度与动态范围。时钟电路的设计原理涉及信号完整性、阻抗匹配与直流偏置,而内部锁相环(PLL)和延迟锁相环(DLL)的配置则是实现精确时序控制的关键技术。这些技术的价值在于,它们共同保障了高速通信、雷达和任意波形生成等应用对信号实时性与精度的严苛要求。本文聚焦于德州仪器(TI)的DAC5681Z,深入解析其外部时钟输入电路的硬件设计要点,包括端接电阻的计算与选型,并详细拆解通过串行外设接口(SPI)对

weixin_30342363的博客 186

spring 拦截器请求类型异常.servlet.resource.ResourceHttpRequestHandler cannot be cast to .method.HandlerMethod

目录 自定义SpringMVC拦截器中HandlerMethod类型转换问题调研 摘要 问题 分析 方案 方案一:修改springMVC拦截器配置 方案二:检查内置tomcat配置 二次分析:先搞清楚问题究竟在哪儿 第一个断点 第二个断点 context-path 方案三:指定context-path 补充 总结 自定义SpringMVC拦截器中HandlerMethod类型转换问题调研 摘要 在将a模块迁移到spring boot项目下、使用embeded tomc.

平凡之路无尽路的博客 9014

Shopee App加密算法逆向实战:从抓包到libshpssdk.so的深度解析

本文详细解析了Shopee App加密算法的逆向过程,从网络抓包发现加密参数入手,通过Frida动态Hook定位到Java层关键方法,并深入追踪至Native层的libshpssdk.so核心函数。文章结合实战演示了如何利用Unidbg模拟执行环境进行算法分析与验证,并探讨了核心参数生成逻辑及风控规避要点,为移动安全与逆向工程研究提供了完整的技术路径。

weixin_28347369的博客 527

直流有刷电机三环PID控制:从硬件配置到软件调试全解析

本文全面解析了直流有刷电机的三环PID控制技术,涵盖从硬件选型(如驱动板、编码器)到STM32软件配置的全过程。详细阐述了位置环、速度环、电流环的串级协同工作原理与调试方法,并提供了位置式PID算法的C语言实现代码及参数整定技巧,旨在帮助开发者实现精准、稳定的电机运动控制。

weixin_29290963的博客 387

java httprequesthandler_Spring-webmvc源码解析之ResourceHttpRequestHandler

基于4.1.7.RELEASE该类继承了WebContentGenerator,WebContentGenerator可以对response进行设置header,设置缓存时间等操作,并且提供了对request的method的检查功能。ResourceHttpRequestHandler 在xml文件中的配置方法当spring检测到这样的配置,启动时会在SimpleUrlHandlerMapping...

weixin_28842367的博客 1231

从Zemax到Speos:HUD设计数据无缝迁移避坑指南(含STEP文件精度验证)

本文详细介绍了从Zemax到Speos的HUD设计数据无缝迁移方法,重点解决Zernike曲面参数保真、虚拟厚度设置和坐标系对齐等核心问题。通过STEP文件精度验证和工程化解决方案,帮助工程师避免数据迁移中的常见陷阱,提升HUD系统设计效率。适用于Ansys Zemax和Ansys Speos用户,优化光学性能验证流程。

h6i7j8的博客 1063

随笔记录-springmvc_ResourceHandlerRegistry+ResourceHttpRequestHandler

记录springboot读取静态资源

XIYECODE的博客 1897

终端效率神器:Tmux 安装与使用全指南

终端效率神器:Tmux 安装与使用全指南

身在被窝_心在编程 1357

手把手教你用Arduino和开源电路DIY一个手机连接的电化学传感器(附GitHub源码)

本文详细介绍了如何利用Arduino和开源电路DIY一个手机连接的电化学传感器,成本不到300元即可复现价值数千元的专业设备。从硬件选型、电路搭建到固件开发和手机应用实现,手把手教你完成整个项目,特别适合科研人员、环境监测爱好者和理工科学生。附GitHub源码,方便快速上手和扩展功能。

weixin_42561040的博客 336

SpringMVC静态资源发布流程(静态如何从文件加载到Resource,最后传给response,以及其专用处理器ResourceHttpRequestHandler源码深入追究)

SpringMVC 加载静态文件,最后又传给response,说完你可能不信,我追踪了一遍!

GDUT_xin的博客 1407

用Pixel5玩转AOSP:从零开始定制Android13系统(含GMS集成方案)

本文提供了一份详尽的Pixel 5 AOSP定制指南,涵盖从环境搭建、源码下载、系统编译到刷机的完整流程。重点解决了原生AOSP缺失Google移动服务(GMS)的难题,分享了从官方镜像提取并集成GMS组件的实战方案,助你打造独一无二的Android 13系统。

sam99的博客 526

SpringBoot基于Web开发

使用Spring Boot开发Web应用是一个高效且流行的选择,因为它极大地简化了Spring应用的初始搭建以及开发过程。

2301_78122337的博客 678

STM32F407+OV2640的DCMI+DMA双缓冲JPEG图像采集系统

在嵌入式视觉系统中,数字摄像头接口(DCMI)是MCU连接CMOS图像传感器的关键硬件通道,其与DMA协同实现零CPU干预的高速数据流采集;而JPEG作为一种基于DCT变换与量化压缩的有损图像格式,依赖传感器端硬件编码引擎才能满足实时性要求。理解DCMI三重同步时序(PCLK/HSYNC/VSYNC)与DMA双缓冲机制的流水线协作原理,是突破带宽瓶颈、避免FIFO溢出和帧丢失的技术基础。该架构广泛应用于智能硬件、工业检测与边缘AI前端等需低功耗、高可靠图像捕获的场景,本文以OV2640与STM32F407为

weixin_42103128的博客 156

VC中sqlite的使用

在VC中对sqlite的使用,实现数据库大批数据的快速插入,读取数据库中的数据在ListCtrl中显示

spring boot web_SpringBoot-Web开发

Web开发1.1、静态资源访问在我们开发Web应用的时候,需要引用大量的js、css、图片等静态资源。默认配置Spring Boot默认提供静态资源目录位置需置于classpath下,目录名需符合如下规则:/static/public/resources/META-INF/resources举例:我们可以在src/main/resources/目录下创建static,在该位置放置一个图片文件。启动...

weixin_39564755的博客 100

TMS_WebGMaps_1.9.8.0_Full_Source

TMS_WebGMaps_1.9.8.0_Full_Source 全源码 delphi cbuilder

SpringBoot 之 Web开发

SpringBoot开发之 Web开发,其中包括 SpringMVC自动配置、拦截器、视图解析模板与内容协商、定制化原理等功能

京茶吉鹿的博客 4210

老版QQ原生表情gif动态

这是老版的QQ表情,不过全是动态的的,Windows照片查看器是不会动的,可以右击用浏览器打开查看,再说一遍是老版的,只是分享给宁愿用老版也要动态的人。

廖雪峰Python教程[完整版]

廖雪峰的python教程整理的,已经排好版了,而且还是完整的,适合小白

SpringBoot Web开发

介绍了SpringBoot有关Web的所有内容

xry12354的博客 430

SpringBoot对Web开发的支持!

Spring Boot对Web开发流程提供完整的支持,包括从前端到后台的开发,再到数据库的操作。使用Spring Boot开发Web工程有两种类型:前后端完全分离。这种方式是前端开发者和后端开发者完全分离地进行项目的开发,最后完成前后端的接口对接,这是目前国内一种流行的开发方式。前端负责页面的开发并调用后端接口展示数据,后端只负责提供API接口。使用Spring Boot自带的模板。这种方式适用于小型项目或者全栈开发人员,一般可以选择的模板包括Freemaker和Thymeleaf等。

IT_1024的博客 789

SpringBoot Web 开发教程(上篇)

组件核心作用Spring 底层核心,提供 IOC、事务、基础 Web、数据访问能力简化 Spring 繁琐 XML 配置,内置服务器,快速搭建独立应用统一各类数据库操作代码规范微服务分布式开发全套工具集项目登录、权限、安全认证框架Web 分为静态资源(页面文件)、动态资源(后端逻辑代码),区分 BS/CS 两种架构;Spring 生态包含 Framework、Boot、Cloud、Security 等组件,SpringBoot 简化配置、快速开发;

mgw1413的博客 268

springboot resources路径_spring boot与web开发

之前我们学习过传统的SSM,JavaWeb,都有过一定的web开发的基础。但是使用SSM发现配置繁琐,原生的JavaWeb,什么都需要自己写自己封装。到了spring boot这个部分,发现一切都变得简单起来了。这次我们就学习怎么使用spring boot进行web开发!基本原理之前我们就简单的使用这个搭建过环境,并且成功跑通了helloworld!我们再来回顾一下这个过程:1....

weixin_39781783的博客 791

SpringBoot07-SpringBoot Web开发总览

Webjars本质就是以jar包的方式引入我们的静态资源 , 我们以前要导入一个静态资源文件,直接导入即可。使用SpringBoot需要使用Webjars,我们可以去搜索一下:网站:https://www.webjars.org要使用jQuery,我们只要要引入jQuery对应版本的pom依赖即可!

xzh202206的博客 1047

SpringBoot之web开发实例

SpringBoot之web开发实例 一 访问首页 默认访问首页使用WebMVCConfigureAdapter来添加视图控制器代替controller中的访问方法 代码实现: @Configuration public class MyMvcConfig extends WebMvcConfigurerAdapter { //所有的WebMvcConfigurerAdapter组件都会一起起作用 @Bean //将组件注册在容器 public WebMvcConfigurerAda

hcyxsh的博客 640

SpringBoot(三):Spring Boot的Web开发

1.Web开发的核心内容主要包括:内嵌servlet容器和SpringMvc 2.SpringBoot的Web开发支持 spring-boot-starter-web为我们提供了嵌入的Tomcat以及SpringMvc的依赖。而Web相关的自动配置存储在spring-boot-autoconfigure.jar的org.springframework.boot.autoconfigure.we...

鹏哥哥Aaa 616

SpringBoot的Web开发

SpringBoot的Web开发 1.使用SpringBoot 创建SpringBoot应用时,选用我们需要的模块 SpringBoot默认将场景配置好(autoConfiguration),只需在配置文件中指定少量配置 编写业务代码 2.SpringBoot对静态资源的映射规则 public void addResourceHandlers(ResourceHandlerRegi...

qq_41096887的博客 156
上一篇: SpringBoot之国际化
下一篇: SpringBoot之RestfulCRUD
章 鱼
博客等级 码龄10年 203粉丝 105原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值