springboot学习笔记:01Building a RESTful Web Service

本文分享了从Eclipse转向IntelliJ IDEA Community版作为Spring Boot开发工具的经验,介绍了项目构建过程,包括pom.xml配置,以及Greeting、GreetingController和Application类的创建。并探讨了项目启动过程中遇到的问题及解决方法。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

使用idea community做开发工具,抛弃eclipse,初学者,少折腾为上。

学习资料地址

http://spring.io/guides/gs/rest-service/

我使用的是maven构建项目方式

按照文章里介绍的,依次修改活新建:

pom.xml

src/main/java/hello/Greeting.java

src/main/java/hello/GreetingController.java

src/main/java/hello/Application.java

-----------------

启动项目,我在网上看,有的地方是说直接运行Application.java 就能启动,我实际运行,却不成功。

在eclipse里,进入终端的方式是:在左侧项目名上右键单击,选Show in Local Termial,再选Terminal, 即在eclipse底部出现终端

然后可以依据文档里的方式,在终端里输入:

./mvnw spring-boot:run   或   mvnw spring-boot:run 

Building RESTful Web Services with Spring 5 – Second Edition: Leverage the power of Spring 5.0, Java SE 9, and Spring Boot 2.0 Find out how to implement the REST architecture to build resilient software in Java with the help of the Spring 5.0 framework. REST is an architectural style that tackles the challenges of building scalable web services. In today’s connected world, APIs have taken a central role on the web. APIs provide the fabric through which systems interact, and REST has become synonymous with APIs.The depth, breadth, and ease of use of Spring makes it one of the most attractive frameworks in the Java ecosystem. Marrying the two technologies is therefore a very natural choice.This book takes you through the design of RESTful web services and leverages the Spring Framework to implement these services. Starting from the basics of the philosophy behind REST, you’ll go through the steps of designing and implementing an enterprise-grade RESTful web service. Taking a practical approach, each chapter provides code samples that you can apply to your own circumstances.This second edition brings forth the power of the latest Spring 5.0 release, working with MVC built-in as well as the front end framework. It then goes beyond the use of Spring to explores approaches to tackle resilience, security, and scalability concerns. Improve performance of your applications with the new HTTP 2.0 standards. You’ll learn techniques to deal with security in Spring and discover how to implement unit and integration test strategies.Finally, the book ends by walking you through building a Java client for your RESTful web service, along with some scaling techniques using the new Spring Reactive libraries. What You Will Learn Deep dive into the principles behind REST Expose CRUD operations through RESTful endpoints with the Spring Framework Devise response formats and error handling strategies, offering a consistent and flexible structure to simplify integration for service consumers Follow the best approaches for dealing with a service’s evolution while maintaining backward compatibility Understand techniques to secure web services Comply with the best ways to test RESTful web services, including tips for load testing Optimise and scale web services using techniques such as caching and clustering
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值