摘要: 在项目中引入了freemarker的依赖包。但是在log4j.properties文件中没有配置对应的日志级别引起的红色警告。如下: <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-st 阅读全文
posted @ 2021-03-19 17:35 浅笑19 阅读(569) 评论(0) 推荐(0)
摘要: 1、设置ContentType response.setContentType("application/x-download"); 2、设置文件名,并指定编码格式 fileName = URLEncoder.encode("浏览器要显示的文件名", "UTF-8"); response.setCh 阅读全文
posted @ 2021-03-19 16:51 浅笑19 阅读(1415) 评论(0) 推荐(0)
摘要: jar:itext-4.2.1.jar 在很多公文的落款处都需要绝对定位,所以记录此代码如下: PdfWriter writer = PdfWriter.getInstance(document, new FileOutputStream("test.pdf")); PdfContentByte c 阅读全文
posted @ 2021-03-19 16:49 浅笑19 阅读(180) 评论(0) 推荐(0)
摘要: BigDecimal的运算——加减乘除 首先是bigdecimal的初始化 这里对比了两种形式, 第一种直接value写数字的值,第二种用string来表示 BigDecimal num1 = new BigDecimal(0.005); BigDecimal num2 = new BigDecim 阅读全文
posted @ 2021-03-19 16:48 浅笑19 阅读(194) 评论(0) 推荐(0)
摘要: <html> <head> <title>测试页面</title> </head> <body> 学生列表:<br> <table border="1"> <tr> <th>序号</th> <th>学号</th> <th>姓名</th> <th>年龄</th> <th>家庭住址</th> </tr> 阅读全文
posted @ 2021-03-19 16:45 浅笑19 阅读(1398) 评论(0) 推荐(0)
摘要: # 是否允许HttpServletRequest属性覆盖(隐藏)控制器生成的同名模型属性。 spring.freemarker.allow-request-override=false # 是否允许HttpSession属性覆盖(隐藏)控制器生成的同名模型属性。 spring.freemarker. 阅读全文
posted @ 2021-03-19 16:43 浅笑19 阅读(457) 评论(0) 推荐(0)
摘要: 最近在springboot项目中使用freemarker时,当页面里取某个空值进行判断,会报异常,异常信息全显示在页面上。通过一个配置,就可以全局解决了在application.properties的freemarker属性配置中加入: spring.freemarker.settings.clas 阅读全文
posted @ 2021-03-19 16:42 浅笑19 阅读(231) 评论(0) 推荐(0)
摘要: import sun.misc.BASE64Decoder; import sun.misc.BASE64Encoder; import java.io.UnsupportedEncodingException; import java.util.Base64; public class Base6 阅读全文
posted @ 2021-03-19 16:41 浅笑19 阅读(166) 评论(0) 推荐(0)
摘要: public void testBigDecimal() { BigDecimal decimal = BigDecimal.ZERO; String x = "5"; for (int i = 0; i < 3; i++) { decimal.add(new BigDecimal(x)); } S 阅读全文
posted @ 2021-03-19 16:40 浅笑19 阅读(146) 评论(0) 推荐(0)