《Spring in Action》第1章-开始使用Spring

Spring实战----Taco Cloud(墨西哥煎玉米卷在线订购系统) 记录一下根据《Spring实战(第五版)》(人民邮电出版社)所学习的过程,搭建一个墨西哥煎玉米卷在线订购系统 阅读详情

开始使用Spring


1、构建一个Spring应用

使用Spring Initializr构建应用:

2、构建后的应用结构

在构建项目时我们选择以下的依赖:

生成的项目结构如下:

  • mvnw和mvnw.cmd是maven的打包脚本,及时我们没有安装maven,也可以用这个脚本来构建项目。
  • TacoCloudApplication.java是Spring Boot的主类,它会引导项目运行。

在pom.xml中:

 <build>
    <plugins>
 	   <plugin>
 		   <groupId>org.springframework.boot</groupId>
 		   <artifactId>spring-boot-maven-plugin</artifactId>
 	   </plugin>
    </plugins>
 </build>

这是一个Spring Boot插件,它有一下几个重要功能:

  • 它提供了一个Maven目标:允许我们使用Maven运行项目

  • 它确保所有的依赖都被包含在可执行jar包中,且在运行时classpath中可用

  • 生成一个manifest文件,指定程序引导类(TacoCloudApplication.java)为可执行jar包的主类。

    如果没有加这个插件,构建的项目jar包目录结构如下:

    只有项目相关的代码和资源,没有依赖包,执行这个jar包包下面的错误:

    加上插件后的jar包目录结构:

    在BOOT-INF目录下,不仅有项目代码和资源,还有所有的依赖包:

3、程序引导类

 package tacos;

 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;

 @SpringBootApplication
 public class TacoCloudApplication {

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

 }

最简洁最重要的一行代码-@SpringBootApplication,这个注解是一个综合注解,它包含其它三个注解:

  • @SpringBootConfiguration:定义这个类为一个配置类,可以在这个类中编写基于java的配置代码。改注解是@Configuration的一个特殊形式。
  • @EnableAutoConfiguration:允许Spring Boot自动配置。
  • @ComponentScan:允许扫描组件。这将允许我们使用@Controller,@Service和@Component等注解。

另一个重要的代码块-main方法:这是一个样板代码,在jar文件运行是,这个方法被调用。该方法调用了静态方法run,该方法完成真正的应用程序引导,创建Spring应用的上下文。该方法接收两个参数:一个是配置类,一个是命令行参数。虽然配置类不一定必须是引导类,但是将引导类传给run方法是一个非常方便且典型的选择。

4、处理Web请求

Spring MVC 是一个非常强大的Web框架,它的中心理念就是controller,controller类负责处理请求并返回数据。

一个简单的controller类:

 @Controller
 public class HomeController {

    @GetMapping("/")
    public String home(){
 	   return "home";
    }
 }
  • @Controller注解的主要作用就是声明该类为已个组件,以供容器自动扫描。@Component,@Service和@Repository功能也一样,上面使用这3个注解效果一样,但是使用@Controller可以描述这个类在应用中的职责。
  • 被@GetMapping注解的home方法将处理根路径为"/"的HTTP GET请求。home方法返回一个字符串,这个字符串将会被解释为一个视图的逻辑名。
  • 因为我们使用了Thymeleaf模板引擎,所以我们可以使用Thymeleaf来定义视图模板。模板的名字由逻辑名加上前缀/templates/和后缀.html派生而来,所以我们应该在/src/main/resources/templates中创建一个名为home.html的模板。

编写视图模板:

 <!DOCTYPE html>
 <html xmlns="http://www.w3.org/1999/xhtml"
 	 xmlns:th="http://www.thymeleaf.org">
 <head>
    <meta charset="UTF-8">
    <title>Taco Cloud</title>
 </head>
 <body>
    <h1>Welcom to</h1>
    <img th:src="@{/images/TacoCloud.jpg}">
 </body>
 </html>

在<img/>标签中,使用了Thymeleaf的th:src元素和@{}表达式来引用图片。图片应该被放在/src/main/resources/static/images/目录下。

编写一个测试用例用来测试controller:

 import static org.hamcrest.Matchers.containsString;
 import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
 import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content;
 import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
 import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.view;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest;
 import org.springframework.test.context.junit4.SpringRunner;
 import org.springframework.test.web.servlet.MockMvc;
 import tacos.controller.HomeController;

 @RunWith(SpringRunner.class)
 @WebMvcTest(HomeController.class) //HomeController的web测试
 public class ControllerTest {
    @Autowired
    private MockMvc mockMvc; //注入MockMvc
    @Test
    public void testHomePage() throws Exception{
 	   mockMvc.perform(get("/")) //执行HTTP GET 请求
 			   .andExpect(status().isOk()) //期望请求状态未200
 			   .andExpect(view().name("home"))//期望返回的视图名为home
 			   .andExpect(content().string(containsString("Welcome to ...")));//期待视图模板中包含Welcome to ... 字符串
    }
 }
  • @WebMvcTest:Spring Boot提供的注解,这个注解将测试放置在Spring MVC应用上下文中运行;上面的测试中,还将HomeController注册在Spring MVC中,这样我们才能对其进行请求。

我们运行这个测试类,如果所有的结果符合预期的话,测试通过,在idea中的图标可能是这样的:

5、Spring Boot DevTools

DevTools提供了非常方便的开发时工具:
* 当代码改变时,自动重启应用
* 当以浏览器为目标的资源改变时,自动刷新页面
* 自动关闭模板缓存
* 如果H2在用,内置H2控制台

在使用Intellij idea进行开发时,尽管依赖了DevTools,但是不起作用,此时需要对idea进行设置:File>settings>Build,Execution,Deployment>Compiler 下选中Build Project Automatically,然后Shift+Ctrl+Alt+/,选择Registry,选中compile.automake.when.app.running (参考自博客:https://blog.csdn.net/wjc475869/article/details/52442484)

  • 应用自动重启:

    当DevTools在项目中起作用时,应用将在JVM中被加载进两个独立的类加载器中。一个类加载器加载我们项目下/src/main/目录下的任何资源;另一个加载器加载项目的依赖包。当改变被探测到,DevTools只重新加载第一个类加载器并重启Spring应用上下文,另一个类加载器不会被重新加载。

  • 浏览器自动刷新和关闭模板缓存

    当我们修改了以浏览器为目标的资源后,只需要刷新页面便可看到改变。我们还可以为浏览器添加LiveReload插件,这样我们连刷新按钮都不用按(当DevTools起作用时,项目启动时会同时启动一个LiveReload服务)。

  • 内置H2控制台

    当我们在开发时使用H2数据库,DevTools会自动开启一个H2控制台,我们通过浏览器访问http://localhost:8080/h2-console来查看数据库的记录。

Spring In Action 第四版:中文、英文、源码 Spring In Action 第四版 英文、中文PDF、各章的源代码 敬请下载: 链接:http://pan.baidu.com/s/1bpMeG9L 密码:8gva 附图: 源码: 程序员实战技能,扫一扫学习 阅读详情

相关推荐

《Spring In Action》随书源码解析与应用

在本章节中,我们详细探讨了 Spring 框架中的核心概念和组件。我们从容器的生命周期、事件驱动模型、Bean 的创建和管理,深入到 Spring 应用的配置与管理,覆盖了基于 XML、注解和 Java 配置的方式。这将为我们深入理解 Spring 提供坚实的基础。

weixin_33670640的博客 1002

SpringBoot in Action——初识SpringBoot

现在,我们里利用了整本书的篇幅来介绍Spring。尽管Spring带来的主要益处就是简化Java开发,但本章将会介绍Spring Boot如何让这项任务变得更简单。 Spring Boot在Spring之上,构建了全新的开发模式,移除了开发Spring应用中很多单调乏味的东西。 我们首先整体了解一下Spring Boot,看它是怎么简化Spring的。 Spring Boot简介 在Spring家...

No_Game_No_Life_的博客 1770

Spring.Boot.in.Action.2015.12.pdf

Spring.Boot.in.Action.2015.12.pdfFor online information and ordering of this and other manning books, please visit www.manning.com.thepublisheroffersdiscountsonthisbookwhenorderedinquantity For more information, please contact Special sales department Manning publications co 20 Baldwin Road PO BoX 761 Shelter island. ny11964 Emailorders@manning.com @2016 by manning Publications Co. All rights reserved No part of this publication may be reproduced, stored in a retrieval system, or transmitted,in any form or by means electronic, mechanical, photocopying, or otherwise, without prior written permission of the publisher. Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. Where those designations appear in the book, and manning Publications was aware of a trademark claim, the designations have been printed in initial caps ll Recognizing the importance of preserving what has been written, it is Mannings policy to have the books we publish printed on acid-free paper, and we exert our best efforts to that end Recognizing also our responsibility to conserve the resources of our planet, Manning books are printed on paper that is at least 15 percent recycled and processed without the use of elemental chlorine Manning publications co Development editor: Cynthia Kane 20 Baldwin Road Technical development editor: Robert casazza PO BoX 761 Copyeditor: Andy Carroll Shelter island. ny11964 Proofreader: Corbin Collins Technical p der John Guthrie Typesetter: Gordan Salinovic Cover designer: Marija Tudor ISBN9781617292545 Printed in the united states of america 12345678910-EBM-201918171615 contents reword vii pre eface 2x about this book xii acknowledgments xu Bootstarting Spring I 1. 1 Spring rebooted Taking a fresh look at spring 2. Examining spring Boot essentials 4 What Spring Boot isn't 7 1.2 Getting started with Spring boot 8 Installing the spring boot cli 8 Initializing a spring boot project with Spring Initializr 12 3 Summary 22 Developing your first Spring Boot application 23 2.1 Putting spring boot to work 24 Examining a newly initialized spring boot project 26 Dissecting Bc iect build 30 2.2 USing starter dependencies 33 Specifying facet-based dependencies 34. Overriding starter transitive dependencies 35 CONTENTS 2.8 USing automatic configuration 37 Focusing on application functionality 37. Running the application 45. What just happened? 45 2.4 Summary 48 Customizing configuration 49 8.1 Overriding Spring Boot auto-configuration 50 Securing the application 50. Creating a custom security configuration 51. Taking another peek under the covers of auto-configuration55 8.2 Externalizing configuration with properties 57 Fine-tuning auto-configuration 58. Externally configuring application beans 64. Configuring with profiles 69 8.8 Customizing application error pages 71 3.4 Summary 74 Testing with Spring Boot 76 4.1 Integration testing auto-configuration 77 4.2 Testing web applications 79 Mocking spring MvC 80- Testing web security 83 4.3 Testing a running application 86 Starting the server on a random port 87. Testing HTML pages with selenium 88 4.4 Summary 90 Getting Groovy with the spring Boot CLI 92 5.1 Developing a Spring Boot CLI application 93 Setting up the cli project 93 Eliminating code noise with Groovy 94. What just happened? 98 5.2 Grabbing dependencies 100 Overriding default dependency versions 101. Adding dependency repositories 102 5.8 Running tests with the CLI 102 5.4 Creating a deployable artifact 105 5.5 Summary 106 CONTENTS 6 Applying Grails in Spring Boot 107 1 Using gorm for data persistence 108 2 Defining views with groovy server pages 113 6.3 Mixing spring boot with grails 3 115 Creating a new grails project 116 Defining the domain 118 Writing a grails controller 119. Creating the view 120 6.4 Summary 123 Taking a peek inside with the Actuator 124 7.1 Exploring the actuator's endpoints 125 Viewing configuration details 126. Tapping runtime metrics 133 Shutting down the application 139. Fetching application information 140 7.2 Connecting to the Actuator remote shell 141 Viewing the autoconfig report 142. Listing application beans 143 Watching application metrics 144.Invoking actuator endpoints 145 7. 3 Monitoring your application with JMX 146 7.4 Customizing the Actuator 148 Changing endpoint Ds 148 Enabling and disabling endpoints 149 Adding custom metrics and gauges 149- Creating a custom trace repository 153 Plugging in custom health indicators 155 7.5 Securing Actuator endpoints 156 7.6 Summary 159 8 Deploying Spring Boot applications 160 8.1 Weighing deployment options 161 8.2 Deploying to an application server 162 Building a WaRfile 162 Creating a production profile Enabling database migration 168 8.3 Pushing to the cloud 173 Deploying to Cloud Foundry 173 Deploying to Heroku 177 8. Summary 180 appendix a spring Boot developer Tools 187 appendix b spring Boot starters 188 appendix c Configuration properties 195 appendix d spring boot dependencies 232 index 243 In the spring of 2014, the Delivery Engineering team at Netflix set out to achieve a lofty goal: enable end-to-end global continuous delivery via a software platform that facilitates both extensibility and resiliency. my team had previously built two different applications attempting to address Netflix's delivery and deployment needs, but both were beginning to show the telltale signs of monolith-ness and neither met the goals of flexibility and resiliency. What's more, the most stymieing effect of these monolithic applications was ultimately that we were unable to keep pace with our partner's inno- vation. Users had begun to move around our tools rather than with them It became apparent that if we wanted to provide real value to the company and rap- idly innovate, we needed to break up the monoliths into small, independent services that could be released at will. Embracing a microservice architecture gave us hope that we could also address the twin goals of flexibility and resiliency. but we needed to do it on a credible foundation where we could count on real concurrency, legitimate moni- toring, reliable and easy service discovery, and great runtime performance With the jVM as our bedrock, we looked for a framework that would give us rapid velocity and steadfast operationalization out of the box. We zeroed in on Spring Boot Spring Boot makes it effortless to create Spring-powered, production-ready ser- vices without a lot of code! Indeed, the fact that a simple Spring Boot Hello World application can fit into a tweet is a radical departure from what the same functionality required on the vm only a few short years ago. Out-of-the-box nonfunctional features like security, metrics, health-checks, embedded servers, and externalized configura tion made boot an easy choice for us FOREWORD Yet, when we embarked on our Spring boot journey solid documentation was hard to come by. Relying on source code isnt the most joyful manner of figuring out how to properly leverage a frameworks features It's not surprising to see the author of mannings venerable Spring in Action take on the challenge of concisely distilling the core aspects of working with Spring Boot into another cogent book. Nor is it surprising that Craig and the Manning crew have done another tremendously wonderful job! Spring Boot in Action is an easily readable book, as weve now come to expect from Craig and manning From chapter Is attention-getting introduction to Boot and the now legend ary 9Oish-character tweetable Boot application to an in-depth analysis of Boots Actuator in chapter 7, which enables a host of auto-magical operational features required for any production application, Spring Boot in Action leaves no stone unturned. Indeed, for me, chapter 7's deep dive into the Actuator answered some of the lingering questions I've had in the back of my head since picking up Boot well over a year ago. Chapter 8s thor- ough examination of deployment options opened my eyes to the simplicity of cloud Foundry for cloud deployments. One of my favorite chapters is chapter 4, where Craig explores the many powerful options for easily testing a Boot application. From the get- o, I was pleasantly surprised with some of Springs testing features, and boot takes g advantage of them nicely As I've publicly stated before, Spring Boot is just the kind of framework the Java community has been seeking for over a decade. Its easy-to-use development features and out-of-the-box operationalization make java development fun again I,m pleased to report that Spring and spring boot are the foundation of Netflix's new continuous delivery platform. What's more, other teams at Netflix are following the same path because they too see the myriad benefits of boot It's with equal parts excitement and passion that I absolutely endorse craigs book as the easy-to-digest and fun-to-read Spring boot documentation the Java community has been waiting for since Boot took the community by storm. Craigs accessible writ- ing style and sweeping analysis of boot's core features and functionality will surely leave readers with a solid grasp of Boot(along with a joyful sense of awe for it) Keep up the great work Craig Manning Publications, and all the brilliant develop ers who have made spring boot what it is today each one of you has ensured a bright future for the JV ANDREW GLOVER MANAGER, DELIVERY ENGINEERING AT NETFLIX preface At the 1964 New York World's Fair, Walt Disney introduced three groundbreaking attractions:"“it' s a small world,”“ Great Moments with mr. Lincoln," and the“ Carouse of Progress " All three of these attractions have since moved into disneyland and walt Disney world, and you can still see them today My favorite of these is the Carousel of Progress. Supposedly, it was one of Walt Disneys favorites too. It's part ride and part stage show where the seating area rotates around a center area featuring four stages. Each stage tells the story of a family at different time periods of the 20th century-the early 1900s, the 1920s the 1940s, and recent times-highlighting the technology advances in that time period The story of innovation is told from a hand-cranked washing machine, to electric lighting and radio, to automatic dishwashers and television, to computers and voice-activated appliances In every act, the father (who is also the narrator of the show)talks about the latest inventions and says "It cant get any better only to discover that in fact, it does get better in the next act as technology progresses Although Spring doesn't have quite as long a history as that displayed in the Car- ousel of Progress, I feel the same way about Spring as"Progress Dad felt about the 20th century. Each and every Spring application seems to make the lives of developers so much better. Just looking at how Spring components are declared and wired together, we can see the following progression over the history of Spring

《Spring in action 中文版(第4版)》1.1 简化Java开发

文章目录1.1.1 激发POJO的潜能POJO: 简单的Java对象JavaBean1.1.2 依赖注入一句话总结测试问题和实现DI向Bean注入接口的实现对象上下文 1.1.1 激发POJO的潜能 POJO: 简单的Java对象 “Plain Old Java Object”“简单java对象”。POJO的内在含义是指那些没有从任何类继承、也没有实现任何接口,更没有被其它框架侵入的java对象。 JavaBean JavaBean是一个遵循特定写法的Java类,是一种Java语言编写的可重用组件,它的方

soldi_er的博客 825

Spring Boot in Action.pdf 英文版

spring boot in action是一本介绍spring boot development的书籍,详细表述了快速开发所有细节,内容丰富,值得收藏!

taco-cloud:用于订购炸玉米饼的Spring Boot应用程序

taco-cloud:用于订购炸玉米饼的Spring Boot应用程序

《Spring Boot in action》阅读笔记(1,2,3章节)

《Spring Boot in action》阅读笔记(1,2,3章节) 中文名:Spring Boot实战 英文名:Spring Boot in action 作者:Craig Walls 译者:丁雪丰 出版社:人民邮电出版社2016年9月第1版 随书源码:www.manning.com/books/spring-boot-in-action 注:随书源码版本比较老,可以按自己的来 2004年,Spring Framework 1.0正式发布 Spring Boot: 部署、监控、度量等 Spr.

Jalen备忘录 1099

Acute逻辑分析仪TL4134E实战:从触发电平到协议解析的完整避坑指南

本文是一份针对Acute逻辑分析仪TL4134E的实战避坑指南。文章深入解析了触发电平分组、采样率与存储深度权衡、高级触发等核心概念,并提供了混合电压系统测量、eMMC调试内存优化、SPI/I2C/UART协议解析排错等具体配置技巧,帮助硬件工程师和嵌入式开发者高效捕获与分析数字信号,快速定位通信问题。

weixin_29207149的博客 419

Spring boot in action pdf+源码

Spring Boot in action PDF+随书源码 Spring boot in action source 1积分 https://download.csdn.net/download/flyingmonkeyr/10363549 - Spring boot in action pdf 免费 -https://pan.baidu.com/s/1s-E4stWgLcy8...

FlyingMonkeyR的博客 5928

基于OpenCV C++实现工业级形状模板匹配:仿Halcon SBM算法全解析

在计算机视觉和工业自动化领域,模板匹配是一项基础且关键的技术,用于在图像中定位已知目标。其核心原理是通过计算图像区域与预设模板之间的相似度来识别目标位置。传统的基于灰度值的匹配方法对光照变化敏感,鲁棒性不足。而基于边缘梯度方向的形状匹配技术,通过计算轮廓梯度方向的一致性进行相似度度量,从根本上提升了对光照变化的鲁棒性,并支持目标的旋转与缩放,技术价值显著。这项技术广泛应用于工业视觉检测、机器人引导、PCB定位等对精度和稳定性要求极高的场景。本文聚焦于使用开源OpenCV库,从底层仿照Halcon的Shape

weixin_33691817的博客 513

行政数据分析大屏实战:用Tableau从Excel到看板的完整搭建流程(含数据连接与字段计算避坑)

本文详细介绍了如何利用Tableau从Excel数据源搭建行政数据分析大屏的完整流程,涵盖数据准备、连接技巧、计算字段优化、看板设计及动态交互部署。通过五阶工作流,帮助用户高效处理多源异构数据,实现业务洞察与可视化呈现,提升行政数据分析效率。

weixin_29696711的博客 348

《Spring in action》——学习总结(一)

在网上学的很吃力,可能是前面的Java没学好吧,遂在图书馆找了本《Spring in action》看看,刚开始看,感觉还行。Spring 简述通过面向POJO编程、依赖注入、AOP和模板技术四个方面来简化Java开发的复杂性。Tips: POJO,Plain Ordinary Java Object的缩写,但是它通指没有使用Entity Beans的普通java对象,可以把POJO作为支持业务逻

LemonTe-A 3414

生成式引擎优化(GEO):启动GEO优化的5个有效策略

随着生成式AI的普及,传统SEO正被GEO(生成式引擎优化)取代。本文提出GEO五大核心策略:用户意图解析、结构化内容设计、语义关键词优化、对话式内容创作和权威信源建设。研究表明,优化后的内容在AI答案中的引用率提升300%,点击率增长27%。文章还介绍了BERT模型、Schema标记等关键技术工具,并指出未来GEO将向多模态优化、实时数据更新方向发展。企业需避免简单堆砌关键词,应建立长期内容策略,通过结构化、权威性内容在AI时代保持竞争优势。

解锁AI流量新红利!🚀 GEO优化(生成引擎优化)助您掌控AI搜索,让AI成为您的品牌最佳代言人! 2800

Racket 仓库内嵌 lz4(1) 命令手册深度解读:压缩、解压、多线程与全部选项实战指南

本篇技术指南以 Racket 仓库中 ChezScheme 子系统内嵌的 lz4 项目 [programs/lz4.1.md](https://link.gitcode.com/i/79a2b7e8e9c3c3d51f1127bd6d02712b) 命令手册为核心骨架,结合同目录下的 CLI 源码、库实现与测试脚本,系统讲解 `lz4` / `unlz4` / `lz4cat` 三个命令的完整用法

gitblog_00188的博客 967

(四)美赛画图篇:画图模板+画图工具

美赛画图篇:画图模板+画图工具(一)画图模板(二)画图工具 因为散点图、折线图等多与数据有关,且需相关软件生成,故此处多是通用模板。直接替换文字内容即可。 (一)画图模板 1、Visio圆圈图 适合于:指标体系(E题常用) 点击下载:1 C币 如果不想花费且时间充足,悄咪咪地说,在visio-模板搜索可以找到很多。(稍微会耗一点时间) 2、简单指标体系图PPT 适合于指标体系 点击下载:0 C币...

weixin_43689393的博客 1万+

【补充篇】三万字了解AUTOSAR软件架构(一)

主要讲解了AUTOSAR软件架构的分层及各个栈的作用

weixin_47571898的博客 1125

读书笔记:Spring in action 第1章

第1章 Spring之旅1.1 简化Java开发DI(依赖注入)AOP (面向切面编程)1.2 容纳你的Bean使用应用上下文将bean加载到 bean工厂 1.1 简化Java开发 DI(依赖注入) 帮助应用对象彼此之间保持松散耦合 通过DI,对象的依赖关系将由系统中负责协调各对象的第三方组件在创建对象的时候进行设定。对象无需自行创建或管理它们的依赖关系。依赖关系将被自动注入到需要它们的对象当中...

qq_32458133的博客 268

61、增益调度控制器:原理、建模与调优

本文详细介绍了增益调度控制器的原理、建模方法和调优流程。增益调度是一种针对非线性系统的控制策略,通过在不同工作点使用不同的线性控制器实现全局控制。文章涵盖了在Simulink中使用Control System Toolbox模块建模的具体步骤,以及如何利用systune进行增益调度表的调优。同时,还讨论了实际应用中的注意事项、典型案例(如化学反应器和飞机控制),并与其它控制方法进行了对比。最后,文章展望了增益调度控制器的未来发展趋势,包括与人工智能的结合、多目标优化调优以及实时调优能力的提升。

rgv234567的博客 186

20210401#《Spring in action 5》

目录

qq_17079255的博客 2116

【Python3教程】Python3高级篇之uWSGI 安装配置

本文介绍了在Python 3环境中安装和配置uWSGI的完整流程,涵盖基本安装、Flask/Django应用部署、Nginx集成以及systemd管理等关键环节。主要内容包括:uWSGI的安装前提条件,创建简单WSGI应用,编写uWSGI配置文件(.ini格式),与Nginx配合实现生产环境部署,以及使用systemd实现服务管理。文章还提供了常见Web框架(Flask、Django)的部署示例和高级配置建议,如负载均衡、HTTPS设置等。最后列出了权限、端口占用等常见问题的解决方案,为开发者提供了一套完整

No8g攻城狮的博客 448

汉书HE8,好用的汇编代码编写工具

汉书HE8,好用的汇编代码编写工具早期编写汇编代码所用功能强大

《Spring in Action》第3章-使用数据库

Spring与数据库 使用JDBC读写数据 使用JDBC(Java Database Connectivity)完成一次查询: Connection connection = null; PreparedStatement statement = null; ResultSet resultSet = null; try{ connection = dataSource.getConnecti...

风萧水寒的博客 627

ET2012新版免狗免安装绿色软件

ET2012新版免狗免安祖昂绿色软件。,新界面,新视觉,

Spring Microservices in Action - Second Edition 教程

Spring Microservices in Action - Second Edition 教程 项目介绍 Spring Microservices in Action - Second Edition 是一个基于Spring框架的微服务示例项目,由ihuaylupo在GitHub上维护。该项目旨在帮助开发者理解和实践微服务架构,通过具体的代码示例展示如何构建、部署和管理微服务。 项目快速启动...

gitblog_00979的博客 666

精雕软件(JDpaint) 5.5 绿色版

精雕软件(JDpaint) 5.5 绿色版精雕软件(JDpaint) 5.5 绿色版精雕软件(JDpaint) 5.5 绿色版

jdk-8u144-linux-x64.tar.gz.

该资源为搭建Linux系统Java环境用,资源的后缀为tar.gz格式的压缩包

Spring in Action中文版总结

1、struts的action和spring的controller的区别答:action是通过getter setter方法去注入数据的,而controller是通过@注解去实现的。Struts2中的action默认是多例的。spring的controller性能更快。Action每次都要重新new一个2、extends与implements的不同1、在类的声明中,通过关键字extends来创建一...

u011213317的博客 1240

Spring In Action 4

在线学习连接:spring in action 4 关键词解释 名词 解释 EJB Enterprise JavaBean,企业级JavaBean POJO Plain Old Java Object,简单老式Java对象 J2EE Java 2 Enterprise Edition,Java2企业版 DI Dependency Injection,依赖注入,获取对象的过程被反转,获得依赖对象的过程由自身管理变成由IOC容器主动注入 IOC Inversion of Cont

Ranger的博客 1万+

《Spring Boot in Action》【1. 起步】

1 起步 Spring 1.0,改变了企业级Java应用开发。依赖注入和声明式事务。 Spring 2.0,自定义XML命名空间。 Spring 2.5,面向注解的依赖注入模型,@Component和@Autowired,以及Spring MVC编程模型。无需显式声明组件,无需继承一些基础控制器类。 Spring 3.0,全新的基于Java的配置方式,从Spring 3.1开始的@Enable打头的

极客神殿 2243

SPRING IN ACTION: 春天在行动-PART 1

提供有关春天新事物的指南!PART 1 FOUNFATIONAL SPRING

Username1898625 572
上一篇: 核心技术(卷二)02、第1章-正则表达式
下一篇: 《Spring in Action》第2章-创建一个Web应用
风萧水丶寒
博客等级 码龄11年 6粉丝 63原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值