- 博客(15)
- 收藏
- 关注
原创 springBoot 中参数校验 BindingResult 的使用
1.首先参数请求对象中属性添加注解public class AddUserInfoReq{ @Getter @Sette @NotBlank(message="姓名不能为空") private String name; @Getter @Setter @Range(min = 18,message="年龄最小18岁") private I...
2018-11-13 14:20:55
1982
1
原创 stream表达式常用用法
1.定义一个对象集合,填充一些数据 List<Student> stuList = new ArrayList<>(); stuList.add(new Student(1L, "刘一", 20, "男")); stuList.add(new Student(2L, "钱二", 20, "男"));
2018-10-30 15:43:22
2714
1
原创 java中使用HtmlUnit爬虫
1.pom文件中添加依赖<dependency> <groupId>net.sourceforge.htmlunit</groupId> <artifactId>htmlunit</artifactId> <version>2.27</version></depende
2018-10-30 09:23:21
1495
原创 spring boot项目中Schedule定时任务
1.首先在spring boot的入口类Application.java中添加注解@EnableScheduling,允许支持schedule2.建一个类执行定时任务package tz.lion.config;import java.math.BigDecimal;import org.springframework.beans.factory.annotation.Autowired;impo...
2018-04-28 10:42:26
447
原创 Java Web利用POI导出Excel简单实例
@Autowired private HttpServletResponse response; private void export(List<User> userList) { OutputStream stream = null; Workbook workbook = null; try { SimpleDateFormat df = new Si...
2018-04-28 10:34:16
533
原创 springBoot整合hibernate表名总是小写
使用SpringBoot整合Hibernate后创建表,表名总为小写,而注解是大写@Table(name="USER")怎么办呢?我们可以在 application.properties里面添加如下内容即可spring.jpa.hibernate.naming.physical-strategy = cn.studyBoot.dao.strategy.UpperTableStrategyUpper...
2018-04-28 10:25:43
2245
1
转载 Java获取客户端IP地址
JSP里,获取客户端的IP地址的方法是:request.getRemoteAddr(),这种方法在大部分情况下都是有效的。但是在通过了Apache,Squid等反向代理软件就不能获取到客户端的真实IP地址了。如果使用了反向代理软件,将http://192.168.1.110:2046/的URL反向代理为http://www.javapeixun.com.cn /的U
2018-01-11 11:22:57
202
原创 hive启动警告:Establishing SSL connection without server's identity verification is not recommended
启动hive报警告:Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by defau...
2017-11-01 10:00:04
4298
1
原创 Truncated incorrect DOUBLE value: 报错
jjava开发中出现Truncated incorrect DOUBLE value: '‘错误,仔细检查发现sql写错了,写成:update question set question = "床前明月光" and answer = "疑是地上霜" where id = 1应为:update brand_question set question = "床前明月光" ,answer
2017-10-27 15:09:00
3266
转载 CentOS7使用firewalld打开关闭防火墙与端口
1、firewalld的基本使用启动: systemctl start firewalld查看状态: systemctl status firewalld 停止: systemctl disable firewalld禁用: systemctl stop firewalld 2.systemctl是CentOS7的服务管理工具中主要的工具,它融合之前
2017-10-27 10:21:01
249
原创 Error: JAVA_HOME is not set and could not be found 启动hadoop报错
原以为是java环境变量有问题,经反复检查发现环境变量并没有问题,最后经大量查阅发现其实是hadoop里面hadoop-env.sh文件里面的java路径设置不对,在hadoop/etc/hadoop目录下,打开hadoop-env.sh脚本将语句 export JAVA_HOME={$JAVA_HOME} 修改为 export
2017-10-27 08:45:55
911
转载 MySQL5.7版本官方yum方式
访问https://dev.mysql.com/downloads/repo/yum/下载mysql提供的rpm包[html] view plain copy[root@localhost home]# ls mysql57-community-release-el6-11.noarch.rpm [html] vi
2017-10-25 18:40:00
743
原创 redis服务关闭启动简单命令
redis服务关闭:redis-cli -h hostip -p post -a password shutdownredis服务开启:src目录下执行 ./redis-server ../redis.conf修改redis密码:redis.conf中找到 #requirepass行,取消#注释,密码写在后面即可,如requirepass 123456
2017-10-25 18:32:26
2097
原创 sql异常java.lang.IllegalStateException: No data type for node
select a.ascore from Issue i ,Answer a where i.title=? and a.aname=?hibernate中使用hql语句多张表联合查询某一字段时,一定要指定字段是哪个实体类,并且实体类中有这个属性(Answer中必须有ascore属性)。...
2017-08-18 09:01:33
676
原创 使用PuTTy实现windows和linux之间文件上传下载
windows内下载完整的PuTTy安装包而不仅仅是putty.exe这一个文件。PuTTy包中包含多个exe文件,有putty和psftp等exe文件。putty只用于登录linux服务器,在服务器上进行相关操作,没有与自己电脑连接,不能与进行上传下载。psftp用于实现本地文件上传下载。 1.打开psftp,输入open ip(linux
2017-08-15 23:31:39
23337
1
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人