From ae6a6327765fd30817d335e95c970925cb61feb8 Mon Sep 17 00:00:00 2001 From: nightsswatch Date: Mon, 23 Nov 2020 10:41:55 +0800 Subject: [PATCH 1/2] fix typo --- docs/system-design/framework/spring/Spring事务总结.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/system-design/framework/spring/Spring事务总结.md b/docs/system-design/framework/spring/Spring事务总结.md index 1e82a2aa..0bc45c8d 100644 --- a/docs/system-design/framework/spring/Spring事务总结.md +++ b/docs/system-design/framework/spring/Spring事务总结.md @@ -51,7 +51,7 @@ public class OrdersService { 另外,数据库事务的 ACID 四大特性是事务的基础,下面简单来了解一下。 -## 2. 事物的特性(ACID)了解么? +## 2. 事务的特性(ACID)了解么? ![](images/spring-transaction/bda7231b-ab05-4e23-95ee-89ac90ac7fcf.png) @@ -143,7 +143,7 @@ Spring 框架中,事务管理相关最重要的 3 个接口如下: - **`TransactionDefinition`**: 事务定义信息(事务隔离级别、传播行为、超时、只读、回滚规则)。 - **`TransactionStatus`**: 事务运行状态。 -我们可以把 **`PlatformTransactionManager`** 接口可以被看作是事务上层的管理者,而 **`TransactionDefinition`** 和 **`TransactionStatus`** 这两个接口可以看作是事物的描述。 +我们可以把 **`PlatformTransactionManager`** 接口可以被看作是事务上层的管理者,而 **`TransactionDefinition`** 和 **`TransactionStatus`** 这两个接口可以看作是事务的描述。 **`PlatformTransactionManager`** 会根据 **`TransactionDefinition`** 的定义比如事务超时时间、隔离级别、传播行为等来进行事务管理 ,而 **`TransactionStatus`** 接口则提供了一些方法来获取事务相应的状态比如是否新事务、是否可以回滚等等。 @@ -238,7 +238,7 @@ public interface TransactionDefinition { ```java public interface TransactionStatus{ - boolean isNewTransaction(); // 是否是新的事物 + boolean isNewTransaction(); // 是否是新的事务 boolean hasSavepoint(); // 是否有恢复点 void setRollbackOnly(); // 设置为只回滚 boolean isRollbackOnly(); // 是否为只回滚 From 29201e640d1ab490afa26e73f33585ba307fd806 Mon Sep 17 00:00:00 2001 From: nightsswatch Date: Mon, 23 Nov 2020 12:07:54 +0800 Subject: [PATCH 2/2] typo fix --- .../PreparingForInterview/美团面试常见问题总结.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/essential-content-for-interview/PreparingForInterview/美团面试常见问题总结.md b/docs/essential-content-for-interview/PreparingForInterview/美团面试常见问题总结.md index 869416ce..634cdc46 100644 --- a/docs/essential-content-for-interview/PreparingForInterview/美团面试常见问题总结.md +++ b/docs/essential-content-for-interview/PreparingForInterview/美团面试常见问题总结.md @@ -106,7 +106,7 @@ request.getRequestDispatcher("login_success.jsp").forward(request, response); ``` -**重定向(Redirect)** 是利用服务器返回的状态码来实现的。客户端浏览器请求服务器的时候,服务器会返回一个状态码。服务器通过 HttpServletRequestResponse 的 setStatus(int status)方法设置状态码。如果服务器返回 301 或者 302,则浏览器会到新的网址重新请求该资源。 +**重定向(Redirect)** 是利用服务器返回的状态码来实现的。客户端浏览器请求服务器的时候,服务器会返回一个状态码。服务器通过 HttpServletResponse 的 setStatus(int status)方法设置状态码。如果服务器返回 301 或者 302,则浏览器会到新的网址重新请求该资源。 1. **从地址栏显示来说**:forward 是服务器请求资源,服务器直接访问目标地址的 URL,把那个 URL 的响应内容读取过来,然后把这些内容再发给浏览器。浏览器根本不知道服务器发送的内容从哪里来的,所以它的地址栏还是原来的地址。redirect 是服务端根据逻辑,发送一个状态码,告诉浏览器重新去请求那个地址。所以地址栏显示的是新的 URL。 2. **从数据共享来说**:forward:转发页面和转发到的页面可以共享 request 里面的数据。redirect:不能共享数据。