摘要: 1.首先开启邮件传输协议SMTP协议,设定授权登陆密码。 2.添加gradle依赖:compile('org.springframework.boot:spring-boot-starter-mail') 3.自动化配置,在application.properties中配置相应的属性内容。 阅读全文
posted @ 2018-02-01 17:41 samcheng 阅读(185) 评论(0) 推荐(0) 编辑
摘要: http://blog.csdn.net/qq_16313365/article/details/4204448 http://blog.sina.com.cn/s/blog_e2c74e2a0101t9nb.html Restrictions用法: 方法说明 方法 说明 Restrictions. 阅读全文
posted @ 2018-01-24 10:18 samcheng 阅读(790) 评论(0) 推荐(0) 编辑
摘要: apache工具包common-lang中有一个很有用的处理字符串的工具类,其中之一就是StringEscapeUtils,这个工具类是在2.3版本以上加上的去的,利用它能很方便的进行html,xml,java等的转义与反转义 阅读全文
posted @ 2017-12-01 09:09 samcheng 阅读(210) 评论(0) 推荐(0) 编辑
摘要: 谷歌的Gson.jar: //list转换为json Gson gson = new Gson(); List<Person> persons = new ArrayList<Person>(); String str = gson.toJson(persons); //json转换为list Gs 阅读全文
posted @ 2017-11-17 09:11 samcheng 阅读(7530) 评论(0) 推荐(0) 编辑
摘要: public class Test { public long stringToLongDate(String str) throws ParseException { SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss" 阅读全文
posted @ 2017-11-14 19:44 samcheng 阅读(3418) 评论(0) 推荐(0) 编辑
摘要: 点击idea右上角的运行主函数的按钮,点击Edit Configurations, 点击Working directory可以在上面更改目录,也可直接点击最后面对应的小图标,选择MODULE_DIR。 阅读全文
posted @ 2017-08-28 16:26 samcheng 阅读(9361) 评论(0) 推荐(0) 编辑
摘要: http://blog.csdn.net/javandroid/article/details/29884033 阅读全文
posted @ 2017-07-25 17:59 samcheng 阅读(114) 评论(0) 推荐(0) 编辑
摘要: 1.https://www.opengps.cn/Data/IP/LocHighAcc.aspx(精确到大致位置) 2.https://www.iplocation.net(国外的) 3.http://www.ip138.com(国内的) 阅读全文
posted @ 2017-07-23 06:24 samcheng 阅读(715) 评论(0) 推荐(0) 编辑
摘要: 思路: 1.创建一个ServerSocket对象。 2.调用ServerSocket对象的accept方法,等待连接,连接成功会返回一个socket对象,否则一直阻塞等待。 3.从Socket对象中获取InputStream与OutputStream字节流,这两个流分别对应request请求与res 阅读全文
posted @ 2017-07-12 16:49 samcheng 阅读(647) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2017-07-12 12:06 samcheng 阅读(649) 评论(0) 推荐(0) 编辑