Zzx Blog

Since 2017


  • 首页

  • 标签

  • 分类

  • 归档

  • 公益404

SpringBoot入门

发表于 2018-03-05 | 分类于 Java , SpringBoot , Spring

SpringBoot依赖

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<!-- springboot组件-->
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.9.RELEASE</version>
</parent>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
<servlet.version>3.1.0</servlet.version>
<junit.version>4.12</junit.version>
<jedis.version>2.9.0</jedis.version>
<druid.version>1.1.6</druid.version>
<mybatisplus.version>2.1.6</mybatisplus.version>
<mybatisplus.spring.boot.version>1.0.5</mybatisplus.spring.boot.version>
<mysql.version>5.1.38</mysql.version>
<commons.lang.version>2.6</commons.lang.version>
<commons.fileupload.version>1.3.1</commons.fileupload.version>
<commons.io.version>2.5</commons.io.version>
<commons.codec.version>1.10</commons.codec.version>
<fastjson.version>1.2.45</fastjson.version>
</properties>
阅读全文 »

SpringMVC整合Mybatis

发表于 2017-12-04 | 分类于 Java , SpringMVC , MyBatis

Maven依赖(mybatis,mysql,oracle,druid连接池)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<!-- mybatis/spring包 -->
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis</artifactId>
<version>3.4.1</version>
</dependency>

<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis-spring</artifactId>
<version>1.3.0</version>
</dependency>

<!--mysql驱动包-->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.35</version>
</dependency>

<!-- Druid -->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid</artifactId>
<version>1.0.26</version>
</dependency>


<!-- oracle driver -->
<dependency>
<groupId>com.oracle.driver</groupId>
<artifactId>jdbc</artifactId>
<version>14</version>
<scope>runtime</scope>
</dependency>
阅读全文 »

SpringMVC配置及整合spring security

发表于 2017-11-30 | 分类于 Java , SpringMVC

SpringMVC

  1. pom文件
  2. springmvc配置
  3. web.xml
  4. spring security配置
  5. java代码

    阅读全文 »

BootStrap-Table

发表于 2017-11-23 | 分类于 Javascript , BootStrap

Bootstrap中文网
Bootstrap-table中文api
Bootstrap-table官网

引入css

bootstrap/css/bootstrap.min.css
bootstrap-table/src/bootstrap-table.css

  • 行内编辑
    文档地址
    bootstrap3-editable/css/bootstrap-editable.css

    引入js

    bootstrap/js/bootstrap.min.js
    bootstrap-table/src/bootstrap-table.js
    bootstrap-table/src/extensions/filter-control/bootstrap-table-filter-control.js
    bootstrap-table/src/extensions/toolbar/bootstrap-table-toolbar.js
    https://cdn.bootcss.com/x-editable/1.5.1/bootstrap3-editable/js/bootstrap-editable.min.js
    bootstrap-table/src/extensions/editable/bootstrap-table-editable.js
  • 中文包
    bootstrap-table/locale/bootstrap-table-zh-CN.min.js

Html代码

  • 可在html配置,或者js配置(本文html配置)

    阅读全文 »

ztree使用(右键点击操作菜单)

发表于 2017-11-23 | 分类于 Javascript

Ztree的使用

  • 效果展示
    文件夹操作
    文件操作
  • html
    1
    <ul id="fileTree" class="ztre" style="background-color:#fff;border:none;margin-top:0;width:100%;height:180px;"></ul>

引入css文件ztree/css/metroStyle/metroStyle.css ztree/js/jquery.ztree.core-3.5.js

  • js
  1. 配置setting,ztreeapi
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28

    var zTree, rMenu, imei; //静态参数,之后用到
    var setting = {
    async: { //异步加载
    enable: true,
    url: "message/operatefile", //后台请求地址
    type: "post",
    autoParam: ["id", "level", "name", "pId"], //默认参数,详见api
    otherParam: ["imei", $("#imei").val()], //自定义参数
    dataFilter: filter
    },
    data: {
    simpleData: {
    enable: true,
    idKey: "id", //自定义配置数据
    pIdKey: "pId",
    rootPId: 2
    }
    },
    view: {
    expandSpeed: "",
    dblClickExpand: false

    },
    callback: {
    onRightClick: OnRightClick, //返回操作,右击树点击事件
    }
    };
阅读全文 »

Git使用教程

发表于 2017-11-22 | 分类于 Git

##安装git

  • git官网下载安装,一路下一步就ok
    ##windows配置git SSH服务
  • cmd运行ssh-keygen -t rsa -C “你的邮箱地址”; (即github的登陆地址)
  • 一路回车,文件会存在C:\Users\Administrator.ssh 目录下
  • 记事本打开id_rsa.pub 文件,并复制内容
  • 登陆github,在用户setting —— SSH and GPG keys 下点击 New SSHkey,填入title(自定义),粘贴文件内容到key,然后点击Add SSH key
  • 打开gitbash 输入
    git config –global user.name “你的用户名” git config –global user.email “你的邮箱”
  • 配置完毕
    阅读全文 »

hexo-next使用教程

发表于 2017-11-22 | 分类于 Hexo

##使用github进行多客户端编辑博客

  1. 创建仓库,http://CrazyMilk.github.io;
  2. 创建两个分支:master 与 hexo;
  3. 设置hexo为默认分支(因为我们只需要手动管理这个分支上的Hexo网站文件);
  4. 使用git clone git@github.com:CrazyMilk/CrazyMilk.github.io.git拷贝仓库;
  5. 在本地http://CrazyMilk.github.io文件夹下通过Git bash依次执行npm install hexo (npm install -g hexo)全局安装hexo、hexo init、npm install 和 npm install hexo-deployer-git(此时当前分支应显示为hexo);
  6. 修改_config.yml中的deploy参数,分支应为master;
  7. 依次执行git add .、git commit -m “…”、git push origin hexo提交网站相关的文件;8. 执行hexo g -d生成网站并部署到GitHub上。
    阅读全文 »

文件MD5

发表于 2017-11-22 | 分类于 Java

*根据文件获取MD5

阅读全文 »

MultipartFile上传——使用详解

发表于 2017-11-22 | 分类于 Java

##上传文件

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
@RequestMapping("/uploadfile")
@ResponseBody
private message uploadfile(@RequestParam("attachment") MultipartFile[] multipartfiles, HttpServletRequest request) throws IOException {
MultipartHttpServletRequest mulReq = (MultipartHttpServletRequest) request;
/*MultipartFile file = mulReq.getFile("attachment");*/
String savePath = "E:\\ludy\\mdm\\attachment";//本地地址
String filename = "";
message retmsg = new message();//返回对象

try {
if (null != multipartfiles && multipartfiles.length > 0) {
//遍历并保存文件
for (MultipartFile file : multipartfiles) {
String originname = file.getOriginalFilename();
//String [] suffix=originname.split(".");
String prefix = originname.substring(originname.lastIndexOf(".") + 1);
filename = mD5(file);
file.transferTo(new File(savePath + "\\" + filename + "." + prefix));
retmsg.setRet("200");
retmsg.setMsg(filename + "." + prefix);//后缀
}
}
} catch (Exception e) {
e.printStackTrace();
}
return retmsg;

}

##上传文件到服务器(尚有问题,但可行)

阅读全文 »

Httpclient使用详解

发表于 2017-11-22 | 分类于 Java

##post请求

阅读全文 »
123
Banksys Zhuang

Banksys Zhuang

Technology

21 日志
13 分类
17 标签
微博 知乎
© 2017 — 2018 Banksys Zhuang
由 Hexo 强力驱动
|
主题 — NexT.Gemini v5.1.3