![](https://img-blog.csdnimg.cn/20201014180756738.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
bug
玄月沐影
there is plan, and there is work.
展开
-
低版本fastjson对Double类型的数据在转json的时候会将精度丢失
版本说明fastjson=>1.1.37具体显示如下public class MyFastJsonTest { public static void main(String[] args) { Map<String, Object> stringObjectMap = new TreeMap<>(); stringObjectMap.put("score", 1.0); String s = JSON.toJSONS原创 2021-07-31 15:42:06 · 1214 阅读 · 0 评论 -
MLog initialization issue: slf4j found no binding or threatened to use its (dangerously silent) NOPL
依赖注意:scope 不要用test <!-- log4j --> <dependency> <groupId>log4j</groupId> <artifactId>log4j</artifactId> <version>1.2.17</version> </dependency> <!-- slf4j-log4j12原创 2021-03-16 19:54:30 · 1001 阅读 · 0 评论 -
跨域问题解决,No ‘Access-Control-Allow-Origin‘ header is present on the requested resource
之前写个简单的图片服务器遇到的一些问题。当一个资源从与该资源本身所在的服务器不同的域、协议或端口请求一个资源时,资源会发起一个跨域 HTTP 请求。开发阶段,不需要记录用户状态、前端没有携带cookie时,则可以这么做:1.对应的方法加上response.setHeader("Access-Control-Allow-Origin", "*");response.setHeader("Cache-Control","no-cache");2.统一的使用过滤器public cla原创 2021-03-13 19:05:58 · 993 阅读 · 0 评论 -
springboot下载docx后打开文件显示有无法解析内容
原来下载核心代码InputStream is = new FileInputStream(file);os = response.getOutputStream();byte[] buffer = new byte[1024];while (is.read(buffer) != -1){ os.write(buffer);}出现下载docx后打开文件显示有无法解析内容方法1InputStream is = new FileInputStream(file);os = r原创 2021-02-25 18:09:56 · 692 阅读 · 0 评论 -
jsp页面中的日期格式化
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %><fmt:formatDate value='${publishdate}' pattern='yyyy-MM-dd'/>原创 2021-02-17 12:57:32 · 206 阅读 · 0 评论 -
ssm + pagehelper 使用问题
java.lang.NoSuchMethodError: net.sf.jsqlparser.statement.select.PlainSelect.getGroupBy()Lnet/sf/jsqljsqlparser版本问题,调高版本pom.xml <dependency> <groupId>com.github.jsqlparser</groupId> <artifactId>jsqlparser</ar原创 2021-02-04 16:09:28 · 69 阅读 · 0 评论 -
关于Mysql数据库时间和查询出来的时间不一致问题
原因:Mybatis连接Mysql的URL使用的时区与Mysql使用的不一致url: jdbc:mysql://127.0.0.1:3306/searchall?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=UTCURL用的是serverTimezone=UTC解决方法:修改spring.datasource.url后面的serverTimezone=UTC为serverTimezo原创 2021-01-20 22:39:13 · 486 阅读 · 0 评论 -
The server time zone value ‘�й���ʱ��‘ is unrecognized or represents more than one time zone.
url中加上:&serverTimezone=UTC原因估计是sql版本问题,以及MySQL的时区未设置原创 2021-01-11 10:02:05 · 73 阅读 · 0 评论 -
Could not find artifact org.springframework.boot:spring-boot-starter-parent:pom:2.4.1
问题描述:Could not find artifact org.springframework.boot:spring-boot-starter-parent:pom:2.4.1降低版本,换到2.1.6.RELEASE成功原创 2021-01-11 08:35:34 · 3769 阅读 · 0 评论 -
IDEA是不会编译src的java目录的xml文件,所以在Mybatis的配置文件中找不到xml文件
1.解决在pom.xml的build标签下增加 <resources> <resource> <directory>src/main/java</directory> <includes> <include>**/*.xml</include> .原创 2021-01-05 15:47:09 · 188 阅读 · 0 评论 -
fastJson针对对象中Date属性避免转为毫秒数。
@JSONField(format = "yyyy-MM-dd HH:mm:ss")原创 2021-01-04 18:57:33 · 742 阅读 · 0 评论 -
jQuery获得select的值
1.获取第一个option的值 $('#test option:first').val();2.最后一个option的值 $('#test option:last').val();3.获取第二个option的值 $('#test option:eq(1)').val();4.获取选中的值 $('#test').val();$('#test opt...原创 2021-01-03 22:25:32 · 565 阅读 · 0 评论 -
select标签更改
<select id="borrowed"> <option value="0">未借出</option> <option value="1">已借出</option></select><script> $(document).ready(function (){ var num = $("#borrowedxx.原创 2021-01-03 21:06:56 · 160 阅读 · 0 评论 -
idea中运行JavaWeb项目js文件找不到
1、js所在的文件夹未设置为资源文件夹,导致编译时候未打入项目原创 2020-12-18 16:53:42 · 2005 阅读 · 1 评论 -
eclipse中不符合编译规范但是可以通过编译还能运行的原因
public interface animal { void run();}public class Cat implements animal { void loud() { System.out.println("asdas"); }}public class Demo1 { public static void main(String[] args) { Cat cat = new Cat(); ca.原创 2020-12-17 15:53:44 · 459 阅读 · 0 评论 -
jsp中显示中文乱码,以及不同页面中中文参数乱码问题
<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8" %>1.在jsp页面中charset和pageEncoding都是utf-8,那么在jsp页面中可以写中文没问题。2.获取中文参数值的时候,POST请求的情况下在用request之前,设置request.setCharacterEncoding("UTF-8");解决获取到的中文不是乱码信息。GET请求的时候,tomca原创 2020-12-12 19:59:32 · 147 阅读 · 0 评论 -
tx-lcn分布式事务框架无法连接远程TM管理服务
java.lang.IllegalStateException: Failed to execute ApplicationRunnerat org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:773) [spring-boot-2.1.6.RELEASE.jar:2.1.6.RELEASE]...原创 2019-10-07 23:05:00 · 2508 阅读 · 0 评论 -
redis集群启动失败
Can I set the above configuration? (type 'yes' to accept): yes/usr/local/share/gems/gems/redis-3.0.0/lib/redis/client.rb:79:in `call': ERR Slot 0 is already busy (Redis::CommandError) from /usr/l...原创 2019-10-06 14:34:01 · 1331 阅读 · 0 评论 -
maven打包依赖问题
maven打包依赖问题<build><plugins><plugin><groupId>org.springframework.boot</groupId><artifactId>spring-boot-maven-plugin</artifactId><executions>...原创 2019-10-04 22:44:39 · 418 阅读 · 0 评论