美文网首页
java笔记

java笔记

作者: A徐小帅 | 来源:发表于2020-06-14 17:08 被阅读0次

    基础

    教程

    https://www.liaoxuefeng.com/wiki/1252599548343744

    lambda

    https://www.jianshu.com/p/613a6118e2e0

    参数验证

    https://developer.ibm.com/zh/articles/j-lo-jsr303/

    sprint-boot

    项目初始化

    • 使用https://start.spring.io/生成项目压缩包,用IDEA直接打开。
    • 使用IDEA 新建项目中的Spring Initializr选项,选择Web->Spring Web依赖。

    项目运行方式

    • 使用IDEA的Run DemoApplication main方法。
    • 命令行在项目根目录下运行mvn spring-boot:run
    • 命令行使用java -jar命令:java -jar demo-0.0.1-SNAPSHOT.jar需要先打包。

    集成druid

    https://github.com/alibaba/druid/tree/master/druid-spring-boot-starter

    运行时报错

    • InetAddress.getLocalHost().getHostName() took 5002 milliseconds to respond. Please verify your network configuration (macOS machines may need to add entries to /etc/hosts)并且启动很慢。

    因为本机的hostname没有写入到hosts中,需要手动进行添加,输入命令行输入hostname得到hostname,在etc/hosts中添加解析记录到127.0.0.1与::1的记录,添加完成后项目就会启动飞快。

    ➜  spring-boot-book-v2 git:(master) ✗ hostname
    xstoopdeMacBook-Pro.local
    ➜  spring-boot-book-v2 git:(master) ✗ vi /etc/hosts
    127.0.0.1           xstoopdeMacBook-Pro.local
    ::1                 xstoopdeMacBook-Pro.local
    

    监听器

    使用监听器
    源码分析

    获取请求参数

    https://www.hangge.com/blog/cache/detail_2485.html

    参数验证

    https://juejin.im/post/6844903991621451789

    myBaits

    myBaits-Plus

    https://gitee.com/baomidou/mybatis-plus
    https://gitee.com/baomidou/mybatis-plus-samples

    相关文章

      网友评论

          本文标题:java笔记

          本文链接:https://www.haomeiwen.com/subject/wrqhzhtx.html