一 需求描述

  给一个url,将该url对应网页内的所有的链接查找出来,并补充完整为绝对路径

 简易版

/**
*
* @author Zen Johnny
* @date 2018年4月29日 下午11:19:01
*
*/
package spider; import java.io.BufferedReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLConnection;
import java.util.LinkedList;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern; /**
* java实现爬虫
*/
public class Robot {
public static List<String> captureWebLinks(String url){
List<String> links = new LinkedList<String>();
URL _url = null;
URLConnection urlconn = null;
BufferedReader br = null;
// PrintWriter pw = null;
// String regex = "http://[\\w+\\.?/?]+\\.[A-Za-z]+";
String regex = "http[s]*://[\\w+\\.?/?]+\\.[A-Za-z]+";//url匹配规则
Pattern p = Pattern.compile(regex);
try {
_url = new URL(url);
urlconn = _url.openConnection();
// pw = new PrintWriter(new FileWriter("C:\Users\Zen Johnny\Desktop\robots.txt"), true);
br = new BufferedReader(new InputStreamReader(
urlconn.getInputStream()));
String buf = null;
while ((buf = br.readLine()) != null) {
Matcher buf_m = p.matcher(buf);
while (buf_m.find()) {
// pw.println(buf_m.group());
links.add(buf_m.group());
}
}
} catch (MalformedURLException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} finally {
try {
br.close();
} catch (IOException e) {
e.printStackTrace();
}
// pw.close();
}
return links;
} public static void main(String[] args) {
String url = "http://www.xhu.edu.cn/";
List<String> links = captureWebLinks(url);
for(String item:links)
System.out.println(item);
System.out.println("capture success");
}
}

 output:

http://xiaoyou.xhu.edu.cn
http://oa.xhu.edu.cn
http://jwc.xhu.edu.cn
http://mail.xhu.edu.cn
http://urp.xhu.edu.cn
http://www.lib.xhu.edu.cn
http://english.xhu.edu.cn/main.htm
http://www.xhu.edu.cn/197/list.htm
http://xhjwc.xhu.edu.cn
http://yjs.xhu.edu.cn
http://yyjs.xhu.edu.cn
http://jxjy.xhu.edu.cn
http://fgc.xhu.edu.cn/xkpt/list.htm
http://qk.xhu.edu.cn
http://zb.xhu.edu.cn
http://yjs.xhu.edu.cn/zsgz/list.htm
http://jxjy.xhu.edu.cn/2647/list.htm
http://jy.xhu.edu.cn
http://oice.xhu.edu.cn
http://oice.xhu.edu.cn
http://dfhz.xhu.edu.cn
http://kjy.xhu.edu.cn
http://global.xhu.edu.cn
http://nmc.xhu.edu.cn
http://xhuasset.xhu.edu.cn/2312/list.htm
http://zgs.xhu.edu.cn
http://www.xhu.edu.cn/197/list.htm
http://xhjwc.xhu.edu.cn
http://yjs.xhu.edu.cn
http://yyjs.xhu.edu.cn
http://jxjy.xhu.edu.cn
http://fgc.xhu.edu.cn/xkpt/list.htm
http://qk.xhu.edu.cn
http://zb.xhu.edu.cn
http://yjs.xhu.edu.cn/zsgz/list.htm
http://jxjy.xhu.edu.cn/2647/list.htm
http://jy.xhu.edu.cn
http://oice.xhu.edu.cn
http://oice.xhu.edu.cn
http://dfhz.xhu.edu.cn
http://kjy.xhu.edu.cn
http://global.xhu.edu.cn
http://nmc.xhu.edu.cn
http://xhuasset.xhu.edu.cn/2312/list.htm
http://zgs.xhu.edu.cn
http://news.xhu.edu.cn/56/list.htm
http://news.xhu.edu.cn
http://news.xhu.edu.cn/b4/a6/c56a111782/page.htm
http://news.xhu.edu.cn/b4/a6/c56a111782/page.htm
http://news.xhu.edu.cn/b5/05/c56a111877/page.htm
http://news.xhu.edu.cn/b4/d2/c56a111826/page.htm
http://news.xhu.edu.cn/b4/a7/c56a111783/page.htm
http://news.xhu.edu.cn/b4/a6/c56a111782/page.htm
http://news.xhu.edu.cn/b4/73/c56a111731/page.htm
http://news.xhu.edu.cn/b4/75/c56a111733/page.htm
http://www.xhu.edu.cn/16/list.htm
http://www.xhu.edu.cn/16/list.htm
http://www.xhu.edu.cn/18/list.htm
http://www.xhu.edu.cn/19/list.htm
http://www.xhu.edu.cn/mtxh/list.htm
http://www.xhu.edu.cn/mtxh/list.htm
http://www.xhu.edu.cn/20/list.htm
http://www.xhu.edu.cn/xhsp/list.htm
http://www.xhu.edu.cn/23/list.htm
http://xxgk.xhu.edu.cn
http://lxyz.zt.xhu.edu.cn
http://xx19.xhu.edu.cn
http://xhu.yiban.cn
http://www.xhu.edu.cn/23/list.htm
http://xxgk.xhu.edu.cn
http://lxyz.zt.xhu.edu.cn
http://xx19.xhu.edu.cn
http://xhu.yiban.cn
http://oa.xhu.edu.cn
http://www.lib.xhu.edu.cn
http://kczx.xhu.edu.cn
http://jwc.xhu.edu.cn
http://urp.xhu.edu.cn
http://rsc.xhu.edu.cn/1410/list.htm
http://202.115.144.153/_web/_platform/teacherHome/web/login.jsp
https://www.gpticket.org
http://weibo.com
http://mp.weixin.qq.com
http://xhu.yiban.cn
http://www.beian.gov.cn
http://dcs.conac.cn/js/23/000/0000/60072077/CA230000000600720770001.js
capture success

 

二 程序方法清单

//捕获网页文本内容
String captureWebPageContent(String) //在网页文本中检索并返回其所有链接
List<String> findLinks(String, String) //将URL路径转为路径链表
List<String> dirs(String) //将相对路径恢复为绝对路径
String revertToAbsolutePath(String, String)

三 程序实现

/**
*
* @author Zen Johnny
* @date 2018年4月29日 下午7:22:44
*
*/
package spider; import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.UnsupportedEncodingException;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.LinkedList;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern; public class WebPageSpider {
private static Pattern pattern = null;
private static Matcher matcher = null;
private static BufferedReader br = null;
private static StringBuffer text = null;
private static URL _url = null;
private static List<String> links = null; public static String captureWebPageContent(String url) throws UnsupportedEncodingException, IOException {
text = new StringBuffer();
_url = new URL(url);
br = new BufferedReader(new InputStreamReader(_url.openStream(), "utf-8"));
String line = null;
while( (line = br.readLine()) != null) {
text.append(line);
}
return text.toString();
} /*
在网页文本中检索并返回其所有链接
@param refUrl:参照的绝对路径
Eg:refAbsoluteUrl -> xxxx.com/X/Y/M/L/test.html?key=35435
*/
public static List<String> findLinks(String text, String refAbsoluteUrl) throws MalformedURLException {
links = new LinkedList<String>();
String regex = "((href)|(src)){1}=([\"\'])(.*?)\\4";//\\4:若前面是双(单)引号,则结束的时候也必须是双(单)引号
pattern = Pattern.compile(regex);
matcher = pattern.matcher(text);
String link = null;
while(matcher.find()) {
link = matcher.group().replaceAll("((href=)|(src=)[\"\'])|([\'\"])", "");
if(link.startsWith(".")) {//如果以相对路径开头,则为其默认添加基URL
links.add(revertToAbsolutePath(refAbsoluteUrl, link));
} else if(link.startsWith("/")){//以根路径作为开头
URL tmp_url = new URL(refAbsoluteUrl);
links.add(tmp_url.getHost() + link);
} else if(link.endsWith("#")){//以#作为路径,即 当前路径(参照路径)
links.add(refAbsoluteUrl);
} else {
links.add(link);
} }
return links;
} /*
将URL路径转为路径链表
Eg:xxxx.com/X/Y/M/L/test.html?key=35435 => xxxx.com X Y M L test.html?key=35435
*/
public static List<String> dirs(String url) {
java.util.List<String> dirs = new LinkedList<String>();
String [] dirsArray = url.split("/+");
for(String item : dirsArray) {
// System.out.println(item);//test
dirs.add(item.trim());
}
return dirs;
} /*
将相对路径恢复为绝对路径
@param:curAbsoluteUrl 参照的绝对路径
@param:relativeSubUrl 相对子路径 xxxx.com/X/Y/M/L/test.html?key=35435 /hr/ry/ry => xxxx.com/X/Y/M/L/hr/ry/ry
xxxx.com/X/Y/M/L/ ./../../G/J/d.x => xxxx.com/X/Y/G/J/d.x
*/
public static String revertToAbsolutePath(String refAbsoluteUrl, String relativeSubUrl) {
List<String> refPaths = dirs(refAbsoluteUrl);//参照路径链表
List<String> relativePaths = dirs(relativeSubUrl);//相对路径链表
List<String> dirs = new LinkedList<String>();
StringBuffer path = new StringBuffer(); if(refPaths.get(refPaths.size() - 1).matches("(.)*[\\.\\?](.)*")) {//若参照路径的最后一项以文件或者query形式结尾,则删除最后一项
// System.out.println(refPaths.get(dirs.size() - 1));//test
refPaths.remove(refPaths.size() - 1);
} for(String item : relativePaths) {
// System.out.println("item:"+item);//test
if(item.equals("..")) {//上一层路径,则:删除refPaths的最后一项
refPaths.remove(refPaths.size() - 1);
} else if(!item.equals(".")) {//不为当前路径.或者空路径,即:实实在在的路径
if(!item.equals("")) {
refPaths.add(item);
} else {
// System.out.println("【空】");//test
}
}
}
for(int item = 0,size = refPaths.size();item<size;item++) {//test
path.append(refPaths.get(item) + (item+1 == size?"":"/"));
}
return path.toString();
}
}

  

四 测试

package test;

import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.URL;
import java.util.List; import org.junit.Test; import spider.WebPageSpider; /**
*
* @author Zen Johnny
* @date 2018年4月29日 下午7:45:21
*
*/ public class WebPageSpiderTest {
// @Test
public void captureWebPageContent() throws UnsupportedEncodingException, IOException {
String url = "http://www.xhu.edu.cn";
System.out.println(WebPageSpider.captureWebPageContent(url));
} @Test
public void findLinks() throws UnsupportedEncodingException, IOException {
String urlString = "http://www.xhu.edu.cn/rcpy/list.htm";
URL url = new URL(urlString);
System.out.println("【Origin Url:" + url.toString() + "】");//test:http://www.xhu.edu.cn/rcpy/list.htm
List<String> links = WebPageSpider.findLinks(WebPageSpider.captureWebPageContent(url.toString()),url.toString());
for(String item:links) {
System.out.println(item);
}
} // @Test
public void revertToAbsolutePath() {
String refAbsoluteUrl = "xxxx.com/X/Y/M/L/test.html?key=35435";
String relativeSubUrl = "/hr/uy/rk/3535";
System.out.println(WebPageSpider.revertToAbsolutePath(refAbsoluteUrl, relativeSubUrl));
} public static void main(String[] args) throws UnsupportedEncodingException, IOException {
// findLinks();
}
}

output:

【Origin Url:http://www.xhu.edu.cn/rcpy/list.htm】
www.xhu.edu.cn/_css/_system/system.css
www.xhu.edu.cn/_upload/site/1/style/1/1.css
www.xhu.edu.cn/_upload/site/00/03/3/style/4/4.css
www.xhu.edu.cn/_js/_portletPlugs/simpleNews/css/simplenews.css
www.xhu.edu.cn/_js/_portletPlugs/datepicker/css/datepicker.css
www.xhu.edu.cn/_js/_portletPlugs/sudyNavi/css/sudyNav.css
www.xhu.edu.cn/_js/jquery.min.js
www.xhu.edu.cn/_js/jquery.sudy.wp.visitcount.js
www.xhu.edu.cn/_js/_portletPlugs/datepicker/js/jquery.datepicker.js
www.xhu.edu.cn/_js/_portletPlugs/datepicker/js/datepicker_lang_HK.js
www.xhu.edu.cn/_js/_portletPlugs/sudyNavi/jquery.sudyNav.js
www.xhu.edu.cn/_upload/tpl/00/06/6/template6/css/base.css
www.xhu.edu.cn/_upload/tpl/00/06/6/template6/css/media.css
www.xhu.edu.cn/_upload/tpl/00/06/6/template6/images/ico.ico
www.xhu.edu.cn/_upload/tpl/00/06/6/template6/extends/extends.js
www.xhu.edu.cn/_upload/tpl/00/06/6/template6/js/window.js
www.xhu.edu.cn/_upload/tpl/00/06/6/template6/extends/libs/html5.js
www.xhu.edu.cn/_upload/tpl/00/06/6/template6/css/ie.css
www.xhu.edu.cn/_upload/tpl/00/06/6/template6/extends/libs/pngfix.js
www.xhu.edu.cn/161/list.htm
www.xhu.edu.cn/162/list.htm
http://xiaoyou.xhu.edu.cn/
www.xhu.edu.cn/164/list.htm
www.xhu.edu.cn/163/list.htm
www.xhu.edu.cn/165/list.htm
javascript:void(0)
http://oa.xhu.edu.cn
http://jwc.xhu.edu.cn/
http://mail.xhu.edu.cn/
http://urp.xhu.edu.cn
http://www.lib.xhu.edu.cn/
http://english.xhu.edu.cn/main.htm
www.xhu.edu.cn/main.htm
www.xhu.edu.cn/_upload/tpl/00/06/6/template6/images/logo.png
www.xhu.edu.cn/xxgk/list.htm
www.xhu.edu.cn/24/list.htm
www.xhu.edu.cn/25/list.htm
www.xhu.edu.cn/26/list.htm
www.xhu.edu.cn/60/list.htm
www.xhu.edu.cn/61/list.htm
http://www.xhu.edu.cn/197/list.htm
www.xhu.edu.cn/197/list.htm
www.xhu.edu.cn/198/list.htm
www.xhu.edu.cn/yjy/list.htm
www.xhu.edu.cn/rcpy/list.htm
www.xhu.edu.cn/122/list.htm
http://xhjwc.xhu.edu.cn/
http://yjs.xhu.edu.cn/
www.xhu.edu.cn/125/list.htm
http://yyjs.xhu.edu.cn/
http://jxjy.xhu.edu.cn/
www.xhu.edu.cn/12/list.htm
www.xhu.edu.cn/28/list.htm
www.xhu.edu.cn/30/list.htm
http://fgc.xhu.edu.cn/xkpt/list.htm
http://qk.xhu.edu.cn/
www.xhu.edu.cn/kydw/list.htm
http://www.xhu.edu.cn/rcpy/list.htm
http://zb.xhu.edu.cn/
http://yjs.xhu.edu.cn/zsgz/list.htm
http://jxjy.xhu.edu.cn/2647/list.htm
http://jy.xhu.edu.cn/
http://oice.xhu.edu.cn/
http://oice.xhu.edu.cn/
http://dfhz.xhu.edu.cn
http://kjy.xhu.edu.cn/
http://global.xhu.edu.cn/
www.xhu.edu.cn/15/list.htm
www.xhu.edu.cn/147/list.htm
http://nmc.xhu.edu.cn/
http://xhuasset.xhu.edu.cn/2312/list.htm
http://zgs.xhu.edu.cn/
www.xhu.edu.cn/bgdh/list.htm
www.xhu.edu.cn/xxgk/list.htm
www.xhu.edu.cn/24/list.htm
www.xhu.edu.cn/25/list.htm
www.xhu.edu.cn/26/list.htm
www.xhu.edu.cn/60/list.htm
www.xhu.edu.cn/61/list.htm
http://www.xhu.edu.cn/197/list.htm
www.xhu.edu.cn/197/list.htm
www.xhu.edu.cn/198/list.htm
www.xhu.edu.cn/yjy/list.htm
www.xhu.edu.cn/rcpy/list.htm
www.xhu.edu.cn/122/list.htm
http://xhjwc.xhu.edu.cn/
http://yjs.xhu.edu.cn/
www.xhu.edu.cn/125/list.htm
http://yyjs.xhu.edu.cn/
http://jxjy.xhu.edu.cn/
www.xhu.edu.cn/12/list.htm
www.xhu.edu.cn/28/list.htm
www.xhu.edu.cn/30/list.htm
http://fgc.xhu.edu.cn/xkpt/list.htm
http://qk.xhu.edu.cn/
www.xhu.edu.cn/kydw/list.htm
http://www.xhu.edu.cn/rcpy/list.htm
http://zb.xhu.edu.cn/
http://yjs.xhu.edu.cn/zsgz/list.htm
http://jxjy.xhu.edu.cn/2647/list.htm
http://jy.xhu.edu.cn/
http://oice.xhu.edu.cn/
http://oice.xhu.edu.cn/
http://dfhz.xhu.edu.cn
http://kjy.xhu.edu.cn/
http://global.xhu.edu.cn/
www.xhu.edu.cn/15/list.htm
www.xhu.edu.cn/147/list.htm
http://nmc.xhu.edu.cn/
http://xhuasset.xhu.edu.cn/2312/list.htm
http://zgs.xhu.edu.cn/
www.xhu.edu.cn/bgdh/list.htm
www.xhu.edu.cn/rczp/list.htm
www.xhu.edu.cn/_upload/column/00/79/121/picture.jpg
www.xhu.edu.cn/122/list.htm
http://xhjwc.xhu.edu.cn/
http://yjs.xhu.edu.cn/
www.xhu.edu.cn/125/list.htm
http://yyjs.xhu.edu.cn/
http://jxjy.xhu.edu.cn/
www.xhu.edu.cn/main.htm
www.xhu.edu.cn/rcpy/list.htm
www.xhu.edu.cn/122/list.htm
http://oa.xhu.edu.cn
http://www.lib.xhu.edu.cn/
http://kczx.xhu.edu.cn/
http://jwc.xhu.edu.cn/
http://urp.xhu.edu.cn
http://rsc.xhu.edu.cn/1410/list.htm
http://202.115.144.150/
http://202.115.144.153/_web/_platform/teacherHome/web/login.jsp
http://weibo.com/p/1002061729488283/home?from=page_100206&mod=TAB&is_all=1#place
www.xhu.edu.cn/_upload/tpl/00/06/6/template6/images/weiibo.jpg
http://mp.weixin.qq.com/profile?src=3&timestamp=1463020630&ver=1&signature=IoHgaEnITl0-zOyyrLrEP5mwFoQAfa0U8EOiHghtGIY4im9vnwvNNBLECI5CPdrdfWSDyd0JNBIZBU*j*EOgWA== ;
www.xhu.edu.cn/_upload/tpl/00/06/6/template6/images/weixin.jpg
http://xhu.yiban.cn/
www.xhu.edu.cn/_upload/tpl/00/06/6/template6/images/yiban.png
javascript:SendMailTo(db@mail.xhu.edu.cn)
javascript:SendMailTo(xiaoban@mail.xhu.edu.cn)
www.xhu.edu.cn/190/list.htm
www.xhu.edu.cn/191/list.htm
javascript:;
http://dcs.conac.cn/js/23/000/0000/60072077/CA230000000600720770001.js
www.xhu.edu.cn/_upload/tpl/00/06/6/template6/js/app.js
www.xhu.edu.cn/_upload/tpl/00/06/6/template6/js/comcus.js
www.xhu.edu.cn/_visitcount?siteId=3&type=2&columnId=121

五 缺陷

  目前,只能支持网页字符集编码为JDK所支持的几大类型:ISO8859-1、UTF-8等,不支持GB2312和GBK

六 参考文档

 使用Java实现网络爬虫:https://www.cnblogs.com/qianzf/p/6796588.html

Java SE之网络爬虫①的更多相关文章

  1. Java开发、网络爬虫、自然语言处理、数据挖掘简介

    一.java开发 (1) 应用开发,即Java SE开发,不属于java的优势所在,所以市场占有率很低,前途也不被看好. (2) web开发,即Java Web开发,主要是基于自有或第三方成熟框架的系 ...

  2. Apache Nutch v2.3 发布,Java实现的网络爬虫

    http://www.oschina.net/news/59287/apache-nutch-2-3 Apache Nutch v2.3已经发布了,建议所有使用2.X系列的用户和开发人员升级到这个版本 ...

  3. java 之webmagic 网络爬虫

    webmagic简介: WebMagic是一个简单灵活的Java爬虫框架.你可以快速开发出一个高效.易维护的爬虫. http://webmagic.io/ 准备工作: Maven依赖(我这里用的Mav ...

  4. Java 正则表达式_网络爬虫

    首先 需要了解 一些 关于 网络爬虫的 基本知识: 网络爬虫: 所谓的 爬虫 就是一个 应用 程序, 这个 应用 程序 会 获取 网络中的 指定信息(网页 数据). 例如百度: 启动 这个 爬虫 程序 ...

  5. Java SE之网络编程:知识框架

  6. Java丨jsoup网络爬虫模拟登录思路解析

    直奔主题: 本篇文章是给有jsoup抓包基础的人看的...... 今天小编给大家写一篇对于jsoup抓包时需要输入验证码的解决方法之一.大神就绕道,嘿嘿~ 任何抓包的基础都是基于Http协议来进行这个 ...

  7. 基于 Java 的开源网络爬虫框架 WebCollector

    原文:https://www.oschina.net/p/webcollector

  8. 学 Java 网络爬虫,需要哪些基础知识?

    说起网络爬虫,大家想起的估计都是 Python ,诚然爬虫已经是 Python 的代名词之一,相比 Java 来说就要逊色不少.有不少人都不知道 Java 可以做网络爬虫,其实 Java 也能做网络爬 ...

  9. Heritrix工具实现网络爬虫

    上次用的java相关知识实现了一个简单的网络爬虫,现在存在许多开源免费的爬虫工具,相对来说,可以很简单的获取网页数据,并写入到本地. 下面我就阐述一下我用Heritrix爬虫工具实现网页数据爬取. - ...

随机推荐

  1. What can Reactive Streams offer EE4J?

    https://developer.lightbend.com/blog/2018-02-06-reactive-streams-ee4j/index.html By James Roper (@jr ...

  2. js常用的正则表达式

    一.校验数字的表达式 数字:^[0-9]*$ n位的数字:^\d{n}$ 至少n位的数字:^\d{n,}$ m-n位的数字:^\d{m,n}$ 零和非零开头的数字:^(0|[1-9][0-9]*)$ ...

  3. QML学习笔记(七)— 实现可拖拽、编辑、选中的ListView

    鼠标单击可选中当前项,头部呈绿色显示:按压当前项可进行拖拽更换列表项位置:点击数据可以进行编辑: GitHub:八至 作者:狐狸家的鱼 这里是自己定义的model,有些字体和颜色都是使用的全局属性, ...

  4. Neovim中提示Error: Required vim compiled with +python

    Neovim在编辑python文件时出现错误提示,如下图 原因 出现该错误的原因说明未安装Python2/3的支持 解决方法 使用包管理器安装Neovim的Python支持python-neovim ...

  5. [THUWC2017]在美妙的数学王国中畅游

    [THUWC2017]在美妙的数学王国中畅游 e和sin信息不能直接合并 泰勒展开,大于21次太小,认为是0,保留前21次多项式即可 然后就把e,sin ,kx+b都变成多项式了,pushup合并 上 ...

  6. N球M盒

    N球,M盒,由于球是否相同,盒是否相同,盒是否可以为空,共2^3=8种: 1.球同,盒同,盒不可以为空Pm(N)--这符号表示部分数为m的N-分拆的个数,m是P的下标,为了好看我将大写的M弄成小写 2 ...

  7. PMP认证考试的最新趋势及10大特征(针对改版后)

    我们都知道,今年PMP认证考试的教材已经改版了,最新版的内容是有不少的改动的,我们在了解PMP考试的时候,也要了解PMP考试的最新趋势,以便拿出应对的方法. 一.情景题更接地气 虽然PMP考试中继续保 ...

  8. ElasticSearch6.5.0 【安装IK分词器】

    不得不夸奖一下ES的周边资源,比如这个IK分词器,紧跟ES的版本,卢本伟牛逼!另外ES更新太快了吧,几乎不到半个月一个小版本就发布了!!目前已经发了6.5.2,估计我还没怎么玩就到7.0了. 下载 分 ...

  9. SpringCloud第一弹(入门)

    使用IDEA建立SpringBoot多模块工程不爽啊~算了凑合用吧. 第一步.建立一个POM工程 ..Next ..一路next即可,中间啥也不选 第二步.建立Eureka服务器(这个玩意等同于玩Du ...

  10. SpringBoot整合Freemarker+Mybatis

    开发工具 , 开始 新建工程 .选择Spring Initializr 下一步 下一步,选择需要的组件 ..改一下工程名,Finish ..目录结构 首先,修改pom文件 然后,将applicatio ...