Spring Date TEST 可以用来发布关于 Spring 数据库的 HATEOAS RESTful 资源。
下面是一个使用 JPA 的例子
@RepositoryRestResource(collectionResourceRel = "todos", path = "todos") public interfaceTodoRepository extendsPagingAndSortingRepository<Todo, Long> {
不需要写太多代码,我们可以发布关于 Spring 数据库的 RESTful API。
下面展示的是一些关于 TEST 服务器的例子
POST
-
URL:http://localhost:8080/todos
-
Use Header:Content-Type:Type:application/json
-
Request Content
-
代码如下
-
{ "user": "Jill", "desc": "Learn Hibernate", "done": false }
- 响应内容
{ "user": "Jill", "desc": "Learn Hibernate", "done": false, "_links": { "self": { "href": "http://localhost:8080/todos/1" }, "todo": { "href": "http://localhost:8080/todos/1" } } }
响应包含新创建资源的 href。 欢迎大家加我qq:1038774626探讨技术问题。
相关推荐
以下是为 Spring Date REST Projection 构建示例应用程序的步骤。 Maven 作为构建工具; 后端数据存储是 hsqlDB,JAP 用于持久性和从 DB 中获取对象,Spring boot 将所有内容打包到一个带有嵌入式 tomcat 和 HSQL ...
RESTfull Web服务示例的Spring HMAC身份验证过滤器。 客户端向服务器发送以下http请求: POST /api/echo HTTP/1.1 Accept: application/json, application/*+json Content-Type: application/json Date: Thu, 29 ...
生命游戏使用Spring Boot,Spring MVC,Thymeleaf,Spring Data,JPA,REST,AOP,jQuery,Maven作为Web应用程序编写的生活游戏。 应用程序是用Spring Boot编写的。 您可以通过java -jar lifegame-0.0.1.jar来运行它...
If you are an experienced Java developer, with prior experience in web technologies, and want to step up in your career and stay up-to-date or learn more about Spring Web scalability, this book is for...
Get up to date with the defining characteristics of Spring Boot 2.0 in Spring Framework 5 Learn to perform Reactive programming with SpringBoot Learn about developer tools, AMQP messaging, WebSockets,...
我的应用程序在视图中使用 Spring Boot 和 JS 的 restServer 实现 Rest 服务的应用程序 Rest。 Rest服务器是用Spring Boot(服务器)、Spring REST(消费数据)实现的。服务器测试视图的JSON对象是否正确(所有字段...
spring3.2。 restful访问方式: http://localhost:8080/jsp-rewrite/api/saveUser requestheader:Content-Type=application/json;charset=UTF-8 requestbody:{"id":3,"username":"王五","userpwd":"123456",...
3. New Features and Enhancements in Spring Framework 4.0 ............................................ 17 3.1. Improved Getting Started Experience .........................................................
发票REST端点一个简单的Spring应用程序,用于搜索发票并将其添加到MySQL数据库。 模板是用FreeMarker编写的。要求Java 8 Maven的3.x MySQL 8.0.11(已预先配置了用户,数据库和“发票”表)建立和运行在IntelliJ(或...
Spring Boot 应用程序 mvn spring-boot:run打开WebApp: 去做将 MongoDB 更新到 1.7(取决于 Spring Boot Parent)——使用 Java8 LocalDate 而不是 java.util.Date 更新客户搜索以显示搜索结果
3. New Features and Enhancements in Spring Framework 4.0 ............................................ 17 3.1. Improved Getting Started Experience .........................................................
"date" : "THE DATE IT WAS POSTED" , "time" : 0 , // Time left to view the snippet (0 - unlimited) "views" : 0 // Number of views left for the snippet (0 - unlimited) } GET 获取10个最新的不受限制的...
该Java Spring REST API应用程序将提供数据建模以支持项目管理系统8-up。数据库布局表格布局如下: 用户USER_ID主键,不为null长USERNAME字串ROLE_TYPE_ID长外键(对许多用户来说是一个role_type) 电子邮件字符串...
汇率简单的Spring Boot应用程序:用于检查汇率(RUB)的REST服务。 它使用俄罗斯中央银行的数据应用启动mvn包&& java -jar目标/ exchange-rate-1.0-SNAPSHOT.jarAPI应用询问GET / API /费率/ {code} / {date}参数...
DATE: 2018年9月29日 VERSION: 2.1.0-SNAPSHOT BkHech Boot BkHech Boot是基于Spring Boot 2.0.4.RELEASE构建,一套支持自动配置的快速开发脚手架。 对以下项目做了集成和自动配置。 spring-mvc spring-webflux ...
先决条件JDK 8 Maven 3.3.0或更高版本建造 mvn clean package跑步 mvn spring-boot:run测试添加记录 $ ./tests/put_some_stuff.shHTTP/1.1 200 OKServer: Apache-Coyote/1.1Content-Length: 0Date: Sun, 02 Aug 2015...
Part 2 guides you through a worked example, using Spring, MySQL, and Jetty. Enhanced chapters teach you how to use Selenium to drive your application and handle asynchronous Ajax calls, and new ...
此Java Spring REST API应用程序将为客户端提供端点,以对应用程序数据中包含的数据集执行各种CRUD操作。 使用OAuth2身份验证可确保对这些端点的访问安全。 数据库布局 您的购物车项目中的表格布局应为 所有表均...
必须基于Spring框架(可以使用Spring Boot)开发REST服务,以获取外币对卢布的汇率。 的资源应用作数据源。 库的选择和所有假设均由开发人员决定。 执行任务的结果应包含应用程序的源代码以及构建和启动的指令。 ...