1
0
mirror of https://github.com/Snailclimb/JavaGuide synced 2025-06-16 18:10:13 +08:00

Refresh的单位其实是秒

This commit is contained in:
justlive1 2018-11-27 18:03:01 +08:00 committed by GitHub
parent 5b0db0a1d9
commit 63ce3d9099
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -123,9 +123,9 @@ redirect:低.
## 自动刷新(Refresh)
自动刷新不仅可以实现一段时间之后自动跳转到另一个页面还可以实现一段时间之后自动刷新本页面。Servlet中通过HttpServletResponse对象设置Header属性实现自动刷新例如
```java
Response.setHeader("Refresh","1000;URL=http://localhost:8080/servlet/example.htm");
Response.setHeader("Refresh","5;URL=http://localhost:8080/servlet/example.htm");
```
其中1000为时间单位为毫秒。URL指定就是要跳转的页面如果设置自己的路径就会实现没过一秒自动刷新本页面一次
其中5为时间单位为秒。URL指定就是要跳转的页面如果设置自己的路径就会实现没过一秒自动刷新本页面一次
## Servlet与线程安全