echarts中的series数据循环显示
```javascript
var series=[];
for(var i = 0;i<json.data.length;i++){
series.push({
name: arr_name[i],
type: 'line',
stack: '总量',
// data:[120, 132, 101, 134, 90, 230, 210]
data: arr_sum_long_new[i]
});
}
//...
SpringBoot 做 sitemap.xml # 基于Xstream方式 返回xml
直接先看效果:https://veddy.cn/sitemap.xml
下面看实现的代码:
1、在maven的pom.xml配置文件中增加maven依赖:
```
<dependency>
<groupId>com.thoughtworks.xstream</groupId>
<artifactId>xstream</artifactId>
<version>1.4.11.1</version>
</dependency>
```
2、编写代码:
```java
import com.thoughtworks.xstream.annotations.XStre
springboot开启gzip压缩
## springboot 2.x开启gzip压缩
### 1.application.yml配置
```
server:
compression:
enabled: true
min-response-size: 1
mime-types: application/json
```
2.代码设置(application.yml配置与代码设置二选一)
```java
@Bean
public WebServerFactoryCustomizer<ConfigurableWebServerFactory> webServerFactoryCustomizer(
Linux下测试网速
在Linux下如何测量下载和上传的速度?
这里用到一个Python工具speedtest,speedtest是一个用Python编写的轻量级Linux命令行工具,在Python2.4至3.4版本下均可运行。它基于Speedtest.net的基础架构来测量网络的上/下行速率。安装speedtest很简单——只需要下载其Python脚本文件。
### 1、安装speedtest
```shell
$ wget https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.py
$ chmod a+rx speed
Java获取登录用户的IP地址
java获取登录用户的IP地址
项目中经常会使用一些类,类帮助项目更好运行,功能更加完善,人性化~
经常放在util目录中.用到的是,HttpServletRequest,他继承来自ServletRequest的接口,调用里面的方法。
获取登录用户的IP地址
```java
public class IpUtil {
/**
* 获取登录用户的IP地址
*
* @param request
* @return
*/
public static String getIpAddr(HttpServletRequest req
https中请求http资源报错Mixed Content
HTTPS页面里动态的引入HTTP资源,比如引入一个js文件,会被直接block掉的.在HTTPS页面里通过AJAX的方式请求HTTP资源,也会被直接block掉的。
解决:
页面的head中加入:
<pre style='background-color:rgb(245, 245, 245);'>
<meta http-equiv="content-security-policy" content="upgrade-insecure-requests">
</pre>
自定义网站鼠标样式
将以下代码放入Css、Html文件中
```css
/** 鼠标样式 开始**/
/** 普通指针样式**/
body {
cursor: url(https://veddy.cn/assets/images/mouse/default.cur), default;
}
/** 链接指针样式**/
a:hover{
cursor:url(https://veddy.cn/assets/images/mouse/link.cur), pointer;
}
/** 鼠标样式 结束**/
```
如何离开当前页面时改变页面标题title
根据浏览器标签页的切换来改变标签页的title看到一个很有意思的HTML5事件,visibilitychange事件在当前网页在可见和不可见之间变换的时候调用,比如用户切换到其他页面。
那么如何使用它呢?
方法很简单,只需要将下面代码加入页面即可。
```javascript
document.addEventListener('visibilitychange', function () {
if (document.visibilityState == 'hidden') {
normal_title = document.title;
doc
网站变灰JS代码
```javascript
$(function () {
$("#heibai").html("html{-webkit-filter:grayscale(100%);-moz-filter:grayscale(100%);-ms-filter:grayscale(100%);-o-filter:grayscale(100%)}");
})
```
SpringBoot2.0实现自定义404页面渲染
注意:
1、404.html一定要建在template/static下面,否则无效。
2、new ErrorPage可以重定向具体的html也可以重定向请求地址,如/404,那就需要添加/404的Controller
1、第一种写法:实现ErrorPageRegistrar
```java
@Configuration
public class ErrorConfigurar implements ErrorPageRegistrar {
@Override
public void registerErrorPages(ErrorPageRegistry regist
- 1
- 5
- 6
- 7
- 8
- 9
- 10
标签
最新评论

维帝1 评论于 2022-07-06 :

维帝2 评论于 2022-07-06 :

维帝3 评论于 2022-07-06 :

维帝4 评论于 2022-07-06 :

维帝5 评论于 2022-07-06 :
站长说
站长说标题
2022-07-06 09:01
网站信息
文章总数:87篇
最后活动时间:2022年06月29日10时
网站运行天数:857天9时2分56秒