0

bootStrap-table加载从服务器返回的数据,中文会乱码?
这是表格初始化的代码

**

**
其实上面都没有疑问都是对的!

动态创建列代码

请求后台数据也是中文的

到了前端

这是返回的javaBean

public class VideoChildTableModel {

private String id;

private String name;

private double length;

private int status;

@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
private Date uploadDate;

public String getId() {
    return id;
}

public void setId(String id) {
    this.id = id;
}

public String getName() {
    return name;
}

public void setName(String name) {
    this.name = name;
}

public double getLength() {
    return length;
}

public void setLength(double length) {
    this.length = length;
}

public int getStatus() {
    return status;
}

public void setStatus(int status) {
    this.status = status;
}

public Date getUploadDate() {
    return uploadDate;
}

public void setUploadDate(Date uploadDate) {
    this.uploadDate = uploadDate;
}

public VideoChildTableModel(String id, String name, double length, int status, Date uploadDate) {
    super();
    this.id = id;
    this.name = name;
    this.length = length;
    this.status = status;
    this.uploadDate = uploadDate;
}

public VideoChildTableModel() {
    super();
    // TODO Auto-generated constructor stub
}

}
html的头部也是utf-8

然后我自己请求了一下后台数据

然后自己又写了个ajax请求实验

这个真的不知道是哪儿的问题乱了!只能是这个插件的问题了!我觉得有没有大佬在用的时候遇到过这个问题!前端真的头痛!

撰写答案