- 浏览: 68791 次
- 性别:
- 来自: 深圳
文章分类
最新评论
-
Alex_Cheung:
对了,第二个没有提取码,请知悉。
一大波视频分享 -
Alex_Cheung:
谢谢分享。
一大波视频分享 -
Jiy:
很详细,谢谢分享
java并发之同步辅助类Phaser -
walle1027:
非常不错,学习了。
java并发之同步辅助类Phaser -
huangjinjin520:
somefuture 写道除了单词写错了 其他挺好的已更正
dubbo注解使用详解
Spring 的优秀工具类盘点
( http://www.ibm.com/developerworks/cn/java/j-lo-spring-utils1/index.html )
文件资源操作
Spring 定义了一个 org.springframework.core.io.Resource 接口,Resource 接口是为了统一各种类型不同的资源而定义的,Spring 提供了若干 Resource 接口的实现类,
这些实现类可以轻松地加载不同类型的底层资源,并提供了获取文件名、URL 地址以及资源内容的操作方法
访问文件资源
通过 FileSystemResource 以文件系统绝对路径的方式进行访问;
通过 ClassPathResource 以类路径的方式进行访问;
通过 ServletContextResource 以相对于 Web 应用根目录的方式进行访问。
package com.baobaotao.io;
import java.io.IOException;
import java.io.InputStream;
import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.FileSystemResource;
import org.springframework.core.io.Resource;
public class FileSourceExample {
public static void main(String[] args) {
try {
String filePath =
"D:/masterSpring/chapter23/webapp/WEB-INF/classes/conf/file1.txt";
// ① 使用系统文件路径方式加载文件
Resource res1 = new FileSystemResource(filePath);
// ② 使用类路径方式加载文件
Resource res2 = new ClassPathResource("conf/file1.txt");
InputStream ins1 = res1.getInputStream();
InputStream ins2 = res2.getInputStream();
System.out.println("res1:"+res1.getFilename());
System.out.println("res2:"+res2.getFilename());
} catch (IOException e) {
e.printStackTrace();
}
}
}
在获取资源后,您就可以通过 Resource 接口定义的多个方法访问文件的数据和其它的信息
getFileName() 获取文件名,
getFile() 获取资源对应的 File 对象,
getInputStream() 直接获取文件的输入流。
createRelative(String relativePath) 在资源相对地址上创建新的资源。
在 Web 应用中,您还可以通过 ServletContextResource 以相对于 Web 应用根目录的方式访问文件资源
Spring 提供了一个 ResourceUtils 工具类,它支持“classpath:”和“file:”的地址前缀 ,它能够从指定的地址加载文件资源。
File clsFile = ResourceUtils.getFile("classpath:conf/file1.txt");
System.out.println(clsFile.isFile());
String httpFilePath = "file:D:/masterSpring/chapter23/src/conf/file1.txt";
File httpFile = ResourceUtils.getFile(httpFilePath);
文件操作
在使用各种 Resource 接口的实现类加载文件资源后,经常需要对文件资源进行读取、拷贝、转存等不同类型的操作。
FileCopyUtils
它提供了许多一步式的静态操作方法,能够将文件内容拷贝到一个目标 byte[]、String 甚至一个输出流或输出文件中。
package com.baobaotao.io;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileReader;
import java.io.OutputStream;
import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.Resource;
import org.springframework.util.FileCopyUtils;
public class FileCopyUtilsExample {
public static void main(String[] args) throws Throwable {
Resource res = new ClassPathResource("conf/file1.txt");
// ① 将文件内容拷贝到一个 byte[] 中
byte[] fileData = FileCopyUtils.copyToByteArray(res.getFile());
// ② 将文件内容拷贝到一个 String 中
String fileStr = FileCopyUtils.copyToString(new FileReader(res.getFile()));
// ③ 将文件内容拷贝到另一个目标文件
FileCopyUtils.copy(res.getFile(),
new File(res.getFile().getParent()+ "/file2.txt"));
// ④ 将文件内容拷贝到一个输出流中
OutputStream os = new ByteArrayOutputStream();
FileCopyUtils.copy(res.getInputStream(), os);
}
}
static void copy(byte[] in, File out) 将 byte[] 拷贝到一个文件中
static void copy(byte[] in, OutputStream out) 将 byte[] 拷贝到一个输出流中
static int copy(File in, File out) 将文件拷贝到另一个文件中
static int copy(InputStream in, OutputStream out) 将输入流拷贝到输出流中
static int copy(Reader in, Writer out) 将 Reader 读取的内容拷贝到 Writer 指向目标输出中
static void copy(String in, Writer out) 将字符串拷贝到一个 Writer 指向的目标中属性文件操作
Spring 提供的 PropertiesLoaderUtils 允许您直接通过基于类路径的文件 地址加载属性资源
package com.baobaotao.io;
import java.util.Properties;
import org.springframework.core.io.support.PropertiesLoaderUtils;
public class PropertiesLoaderUtilsExample {
public static void main(String[] args) throws Throwable {
// ① jdbc.properties 是位于类路径下的文件
Properties props = PropertiesLoaderUtils.loadAllProperties("jdbc.properties");
System.out.println(props.getProperty("jdbc.driverClassName"));
}
}
特殊编码的资源
当您使用 Resource 实现类加载文件资源时,它默认采用操作系统的编码格式。
如果文件资源采用了特殊的编码格式(如 UTF-8),则在读取资源内容时必须事先通过 EncodedResource 指定编码格式,否则将会产生中文乱码的问题。
package com.baobaotao.io;
import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.Resource;
import org.springframework.core.io.support.EncodedResource;
import org.springframework.util.FileCopyUtils;
public class EncodedResourceExample {
public static void main(String[] args) throws Throwable {
Resource res = new ClassPathResource("conf/file1.txt");
// ① 指定文件资源对应的编码格式(UTF-8)
EncodedResource encRes = new EncodedResource(res,"UTF-8");
// ② 这样才能正确读取文件的内容,而不会出现乱码
String content = FileCopyUtils.copyToString(encRes.getReader());
System.out.println(content);
}
}
访问 Spring 容器,获取容器中的 Bean,使用 WebApplicationContextUtils 工具类
ServletContext servletContext = request.getSession().getServletContext();
WebApplicationContext wac = WebApplicationContextUtils. getWebApplicationContext(servletContext);
Spring 所提供的过滤器和监听器
延迟加载过滤器
Hibernate 允许对关联对象、属性进行延迟加载,但是必须保证延迟加载的操作限于同一个 Hibernate Session 范围之内进行。
如果 Service 层返回一个启用了延迟加载功能的领域对象给 Web 层,当 Web 层访问到那些需要延迟加载的数据时,由于加载领域对象的 Hibernate Session 已经关闭,这些导致延迟加载数据的访问异常。
Spring 为此专门提供了一个 OpenSessionInViewFilter 过滤器,它的主要功能是使每个请求过程绑定一个 Hibernate Session,即使最初的事务已经完成了,也可以在 Web 层进行延迟加载的操作。
<filter>
<filter-name>hibernateFilter</filter-name>
<filter-class>
org.springframework.orm.hibernate3.support.OpenSessionInViewFilter
</filter-class>
</filter>
<filter-mapping>
<filter-name>hibernateFilter</filter-name>
<url-pattern>*.html</url-pattern>
</filter-mapping>
中文乱码过滤器
<filter>
<filter-name>encodingFilter</filter-name>
<filter-class>
org.springframework.web.filter.CharacterEncodingFilter ① Spring 编辑过滤器
</filter-class>
<init-param> ② 编码方式
<param-name>encoding</param-name>
<param-value>UTF-8</param-value>
</init-param>
<init-param> ③ 强制进行编码转换
<param-name>forceEncoding</param-name>
<param-value>true</param-value>
</init-param>
</filter>
<filter-mapping> ② 过滤器的匹配 URL
<filter-name>encodingFilter</filter-name>
<url-pattern>*.html</url-pattern>
</filter-mapping>
一般情况下,您必须将 Log4J 日志配置文件以 log4j.properties 为文件名并保存在类路径下。
Log4jConfigListener 允许您通过 log4jConfigLocation Servlet 上下文参数显式指定 Log4J 配置文件的地址,如下所示:
① 指定 Log4J 配置文件的地址
<context-param>
<param-name>log4jConfigLocation</param-name>
<param-value>/WEB-INF/log4j.properties</param-value>
</context-param>
② 使用该监听器初始化 Log4J 日志引擎
<listener>
<listener-class>
org.springframework.web.util.Log4jConfigListener
</listener-class>
</listener>
Introspector 缓存清除监听器,防止内存泄露
<listener>
<listener-class>
org.springframework.web.util.IntrospectorCleanupListener
</listener-class>
</listener>
一些 Web 应用服务器(如 Tomcat)不会为不同的 Web 应用使用独立的系统参数,也就是说,应用服务器上所有的 Web 应用都共享同一个系统参数对象。
这时,您必须通过 webAppRootKey 上下文参数为不同 Web 应用指定不同的属性名:如第一个 Web 应用使用 webapp1.root 而第二个 Web 应用使用 webapp2.root 等,这样才不会发生后者覆盖前者的问题。此外,WebAppRootListener 和 Log4jConfigListener 都只能应用在 Web 应用部署后 WAR 文件会解包的 Web 应用服务器上。一些 Web 应用服务器不会将 Web 应用的 WAR 文件解包,整个 Web 应用以一个 WAR 包的方式存在(如Weblogic),此时因为无法指定对应文件系统的 Web 应用根目录,使用这两个监听器将会发生问题。
特殊字符转义
Web 开发者最常面对需要转义的特殊字符类型:
* HTML 特殊字符;
* JavaScript 特殊字符;
HTML 特殊字符转义
* & :&
* " :"
* < :<
* > :>
JavaScript 特殊字符转义
* ' :/'
* " :/"
* / ://
* 走纸换页: /f
* 换行:/n
* 换栏符:/t
* 回车:/r
* 回退符:/b
工具类
JavaScriptUtils.javaScriptEscape(String str);
HtmlUtils.htmlEscape(String str);①转换为HTML转义字符表示
HtmlUtils.htmlEscapeDecimal(String str); ②转换为数据转义表示
HtmlUtils.htmlEscapeHex(String str); ③转换为十六进制数据转义表示
HtmlUtils.htmlUnescape(String str);将经过转义内容还原
Spring框架下自带了丰富的工具类,在我们开发时可以简化很多工作:
1.Resource访问文件资源:
具体有:
ResourceUtils.getFile(url);
FileSystemResource(); ClassPathResource();
ServletContextResource(application,url);
2.文件操作 FileCopyUtils
具体有:
FileCopyUtils.copy(Resource.getFile,new File(Resource.getFile(),getParent()+'目标文件名'));
3.属性文件操作 PropertiesLoaderUtils
具体有:
PropertiesLoaderUtils.loadAllProperties("属性文件名"); --基于类路径
4.EncodedResource(Resource对象,”UTF-8″) 编码资源(特殊的);
5.WebApplicationContextUtils
6.StringEscapeutils 编码解码
关注公众号获取 dubbo视频 springcloud视频
https://pan.baidu.com/s/1IOx1Jg-scGT7Rpq-Inu89g
( http://www.ibm.com/developerworks/cn/java/j-lo-spring-utils1/index.html )
文件资源操作
Spring 定义了一个 org.springframework.core.io.Resource 接口,Resource 接口是为了统一各种类型不同的资源而定义的,Spring 提供了若干 Resource 接口的实现类,
这些实现类可以轻松地加载不同类型的底层资源,并提供了获取文件名、URL 地址以及资源内容的操作方法
访问文件资源
通过 FileSystemResource 以文件系统绝对路径的方式进行访问;
通过 ClassPathResource 以类路径的方式进行访问;
通过 ServletContextResource 以相对于 Web 应用根目录的方式进行访问。
package com.baobaotao.io;
import java.io.IOException;
import java.io.InputStream;
import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.FileSystemResource;
import org.springframework.core.io.Resource;
public class FileSourceExample {
public static void main(String[] args) {
try {
String filePath =
"D:/masterSpring/chapter23/webapp/WEB-INF/classes/conf/file1.txt";
// ① 使用系统文件路径方式加载文件
Resource res1 = new FileSystemResource(filePath);
// ② 使用类路径方式加载文件
Resource res2 = new ClassPathResource("conf/file1.txt");
InputStream ins1 = res1.getInputStream();
InputStream ins2 = res2.getInputStream();
System.out.println("res1:"+res1.getFilename());
System.out.println("res2:"+res2.getFilename());
} catch (IOException e) {
e.printStackTrace();
}
}
}
在获取资源后,您就可以通过 Resource 接口定义的多个方法访问文件的数据和其它的信息
getFileName() 获取文件名,
getFile() 获取资源对应的 File 对象,
getInputStream() 直接获取文件的输入流。
createRelative(String relativePath) 在资源相对地址上创建新的资源。
在 Web 应用中,您还可以通过 ServletContextResource 以相对于 Web 应用根目录的方式访问文件资源
Spring 提供了一个 ResourceUtils 工具类,它支持“classpath:”和“file:”的地址前缀 ,它能够从指定的地址加载文件资源。
File clsFile = ResourceUtils.getFile("classpath:conf/file1.txt");
System.out.println(clsFile.isFile());
String httpFilePath = "file:D:/masterSpring/chapter23/src/conf/file1.txt";
File httpFile = ResourceUtils.getFile(httpFilePath);
文件操作
在使用各种 Resource 接口的实现类加载文件资源后,经常需要对文件资源进行读取、拷贝、转存等不同类型的操作。
FileCopyUtils
它提供了许多一步式的静态操作方法,能够将文件内容拷贝到一个目标 byte[]、String 甚至一个输出流或输出文件中。
package com.baobaotao.io;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileReader;
import java.io.OutputStream;
import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.Resource;
import org.springframework.util.FileCopyUtils;
public class FileCopyUtilsExample {
public static void main(String[] args) throws Throwable {
Resource res = new ClassPathResource("conf/file1.txt");
// ① 将文件内容拷贝到一个 byte[] 中
byte[] fileData = FileCopyUtils.copyToByteArray(res.getFile());
// ② 将文件内容拷贝到一个 String 中
String fileStr = FileCopyUtils.copyToString(new FileReader(res.getFile()));
// ③ 将文件内容拷贝到另一个目标文件
FileCopyUtils.copy(res.getFile(),
new File(res.getFile().getParent()+ "/file2.txt"));
// ④ 将文件内容拷贝到一个输出流中
OutputStream os = new ByteArrayOutputStream();
FileCopyUtils.copy(res.getInputStream(), os);
}
}
static void copy(byte[] in, File out) 将 byte[] 拷贝到一个文件中
static void copy(byte[] in, OutputStream out) 将 byte[] 拷贝到一个输出流中
static int copy(File in, File out) 将文件拷贝到另一个文件中
static int copy(InputStream in, OutputStream out) 将输入流拷贝到输出流中
static int copy(Reader in, Writer out) 将 Reader 读取的内容拷贝到 Writer 指向目标输出中
static void copy(String in, Writer out) 将字符串拷贝到一个 Writer 指向的目标中属性文件操作
Spring 提供的 PropertiesLoaderUtils 允许您直接通过基于类路径的文件 地址加载属性资源
package com.baobaotao.io;
import java.util.Properties;
import org.springframework.core.io.support.PropertiesLoaderUtils;
public class PropertiesLoaderUtilsExample {
public static void main(String[] args) throws Throwable {
// ① jdbc.properties 是位于类路径下的文件
Properties props = PropertiesLoaderUtils.loadAllProperties("jdbc.properties");
System.out.println(props.getProperty("jdbc.driverClassName"));
}
}
特殊编码的资源
当您使用 Resource 实现类加载文件资源时,它默认采用操作系统的编码格式。
如果文件资源采用了特殊的编码格式(如 UTF-8),则在读取资源内容时必须事先通过 EncodedResource 指定编码格式,否则将会产生中文乱码的问题。
package com.baobaotao.io;
import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.Resource;
import org.springframework.core.io.support.EncodedResource;
import org.springframework.util.FileCopyUtils;
public class EncodedResourceExample {
public static void main(String[] args) throws Throwable {
Resource res = new ClassPathResource("conf/file1.txt");
// ① 指定文件资源对应的编码格式(UTF-8)
EncodedResource encRes = new EncodedResource(res,"UTF-8");
// ② 这样才能正确读取文件的内容,而不会出现乱码
String content = FileCopyUtils.copyToString(encRes.getReader());
System.out.println(content);
}
}
访问 Spring 容器,获取容器中的 Bean,使用 WebApplicationContextUtils 工具类
ServletContext servletContext = request.getSession().getServletContext();
WebApplicationContext wac = WebApplicationContextUtils. getWebApplicationContext(servletContext);
Spring 所提供的过滤器和监听器
延迟加载过滤器
Hibernate 允许对关联对象、属性进行延迟加载,但是必须保证延迟加载的操作限于同一个 Hibernate Session 范围之内进行。
如果 Service 层返回一个启用了延迟加载功能的领域对象给 Web 层,当 Web 层访问到那些需要延迟加载的数据时,由于加载领域对象的 Hibernate Session 已经关闭,这些导致延迟加载数据的访问异常。
Spring 为此专门提供了一个 OpenSessionInViewFilter 过滤器,它的主要功能是使每个请求过程绑定一个 Hibernate Session,即使最初的事务已经完成了,也可以在 Web 层进行延迟加载的操作。
<filter>
<filter-name>hibernateFilter</filter-name>
<filter-class>
org.springframework.orm.hibernate3.support.OpenSessionInViewFilter
</filter-class>
</filter>
<filter-mapping>
<filter-name>hibernateFilter</filter-name>
<url-pattern>*.html</url-pattern>
</filter-mapping>
中文乱码过滤器
<filter>
<filter-name>encodingFilter</filter-name>
<filter-class>
org.springframework.web.filter.CharacterEncodingFilter ① Spring 编辑过滤器
</filter-class>
<init-param> ② 编码方式
<param-name>encoding</param-name>
<param-value>UTF-8</param-value>
</init-param>
<init-param> ③ 强制进行编码转换
<param-name>forceEncoding</param-name>
<param-value>true</param-value>
</init-param>
</filter>
<filter-mapping> ② 过滤器的匹配 URL
<filter-name>encodingFilter</filter-name>
<url-pattern>*.html</url-pattern>
</filter-mapping>
一般情况下,您必须将 Log4J 日志配置文件以 log4j.properties 为文件名并保存在类路径下。
Log4jConfigListener 允许您通过 log4jConfigLocation Servlet 上下文参数显式指定 Log4J 配置文件的地址,如下所示:
① 指定 Log4J 配置文件的地址
<context-param>
<param-name>log4jConfigLocation</param-name>
<param-value>/WEB-INF/log4j.properties</param-value>
</context-param>
② 使用该监听器初始化 Log4J 日志引擎
<listener>
<listener-class>
org.springframework.web.util.Log4jConfigListener
</listener-class>
</listener>
Introspector 缓存清除监听器,防止内存泄露
<listener>
<listener-class>
org.springframework.web.util.IntrospectorCleanupListener
</listener-class>
</listener>
一些 Web 应用服务器(如 Tomcat)不会为不同的 Web 应用使用独立的系统参数,也就是说,应用服务器上所有的 Web 应用都共享同一个系统参数对象。
这时,您必须通过 webAppRootKey 上下文参数为不同 Web 应用指定不同的属性名:如第一个 Web 应用使用 webapp1.root 而第二个 Web 应用使用 webapp2.root 等,这样才不会发生后者覆盖前者的问题。此外,WebAppRootListener 和 Log4jConfigListener 都只能应用在 Web 应用部署后 WAR 文件会解包的 Web 应用服务器上。一些 Web 应用服务器不会将 Web 应用的 WAR 文件解包,整个 Web 应用以一个 WAR 包的方式存在(如Weblogic),此时因为无法指定对应文件系统的 Web 应用根目录,使用这两个监听器将会发生问题。
特殊字符转义
Web 开发者最常面对需要转义的特殊字符类型:
* HTML 特殊字符;
* JavaScript 特殊字符;
HTML 特殊字符转义
* & :&
* " :"
* < :<
* > :>
JavaScript 特殊字符转义
* ' :/'
* " :/"
* / ://
* 走纸换页: /f
* 换行:/n
* 换栏符:/t
* 回车:/r
* 回退符:/b
工具类
JavaScriptUtils.javaScriptEscape(String str);
HtmlUtils.htmlEscape(String str);①转换为HTML转义字符表示
HtmlUtils.htmlEscapeDecimal(String str); ②转换为数据转义表示
HtmlUtils.htmlEscapeHex(String str); ③转换为十六进制数据转义表示
HtmlUtils.htmlUnescape(String str);将经过转义内容还原
Spring框架下自带了丰富的工具类,在我们开发时可以简化很多工作:
1.Resource访问文件资源:
具体有:
ResourceUtils.getFile(url);
FileSystemResource(); ClassPathResource();
ServletContextResource(application,url);
2.文件操作 FileCopyUtils
具体有:
FileCopyUtils.copy(Resource.getFile,new File(Resource.getFile(),getParent()+'目标文件名'));
3.属性文件操作 PropertiesLoaderUtils
具体有:
PropertiesLoaderUtils.loadAllProperties("属性文件名"); --基于类路径
4.EncodedResource(Resource对象,”UTF-8″) 编码资源(特殊的);
5.WebApplicationContextUtils
6.StringEscapeutils 编码解码
关注公众号获取 dubbo视频 springcloud视频
https://pan.baidu.com/s/1IOx1Jg-scGT7Rpq-Inu89g
发表评论
-
一大波视频分享
2018-06-09 09:36 10911.ps 链接: https://pan.baidu ... -
利用Sharding-Jdbc实现分表
2018-05-24 22:32 3711你们团队使用SpringMVC+Spr ... -
最近有人说我欺骗消费者,今天来一波视频分享
2018-05-12 21:00 1148最近有人说我欺骗消费者,今天来一波视频分享 dubbo入门 ... -
前端 Java Python等资源合集大放送
2018-04-21 22:11 657如果需要学习视频,欢 ... -
dubbo源码学习(四):暴露服务的过程
2018-04-14 11:38 949dubbo采用的nio异步的通信,通信协议默认为 netty, ... -
dubbo源码学习(四)初始化过程细节:解析服务
2018-04-12 20:32 582今天将真正去看dubbo内部的实现过程,看dubbo的源码前我 ... -
dubbo源码学习(二) : spring 自定义标签
2018-04-09 20:29 597做dubbo的配置时很容易发现,dubbo有一套自己的标签,提 ... -
dubbo源码学习一:基础知识及使用的相关技术
2018-04-05 20:10 652Dubbo是Alibaba开源的分布式服务框架,它最大的特点是 ... -
it技术谱图分享
2018-03-10 22:05 4861、程序开发语言综述 2、前端工程师必备技能 3、 ... -
java面试官如何面试别人
2018-02-20 15:11 4384java面试官如何面试别 ... -
各种技术视频
2018-02-09 21:39 476spring视频回复: 1001 java视频回复: 1002 ... -
Spring核心接口之InitializingBean
2017-12-17 16:12 554一、InitializingBean接口说明 Initiali ... -
Spring核心接口之Ordered
2017-12-16 20:02 611一、Ordered接口介绍 Spring中提供了一个Order ... -
JAVA通过Gearman实现MySQL到Redis的数据同步(异步复制)
2017-12-11 19:34 519MySQL到Redis数据复制方案 无论MySQL还是Red ...
相关推荐
Spring整合Redis工具类,导入redis依赖,并使用工具类,不必使用RedisTemplate调用redis,并且采用java更常用的方式调用方法。
主要介绍了简单了解Spring中常用工具类,非常全面,具有一定参考价值,需要的朋友可以了解下。
SpringBoot之自带工具类常用示例
主要介绍了Spring Utils工具类常用方法实例,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友可以参考下
RSA工具类,囊括了 生成密钥对、私钥解密、公钥加密、私钥签名、公钥验证的方法,并且其中有例子,可直接运行。
Spring不但提供了一个功能全面的应用开发框架,本身还拥有众多可以在程序编写时直接使用的工具类,您不但可以在Spring应用中使用这些工具类,也可以在其它的应用中使用,这些工具类中的大部分是可以在脱离Spring框架...
适合Java开发人员使用的工具类,包括常用pom依赖,POI,分页,spring基本配置文件等。
详细整理spring及guava相关工具类的使用说明、以及详细的代码demo
主要包含的工具: 1、敏感字的过滤 2、文件的各种操作 3、图片的验证码,图片裁剪 4、获取客户端的ip 5、md5加密,加密解密 6、对象的clone 7、获取操作系统的版本 8、String的操作 9、Date的操作 10、...
这个jar文件包含Spring框架基本的核心工具类,Spring其它组件要都要使用到这个包里的类,是其它组件的基本核心,当然你也可以在自己的应用系统中使用这些工具类。 (2) spring-beans.jar 这个jar文件是所有应用...
springboot 实战项目中如何集成 Redis ,并且封装了超详细易用的 Redis 操作工具类。
参考资料 http://wen66.iteye.com/blog/830719; 该文的jar缺文件 我补上了 不知道还有没有其他错误
spring的注解:包括常用的注解参数,以及参数的使用、意义。
redis资源下载,及spring boot的基本配置文件搭建以及常用的工具类方法
(1) spring-core.jar 这个jar文件包含Spring框架基本的核心工具类,Spring其它组件要都要使用到这个包里的类,是其它组件的基本核心,当然你也可以在自己的应用系统中使用这些工具类。 (2) spring-beans.jar 这个...
动态语言支持 第5篇 展现层应用 第19章 Spring MVC之一 第20章 Spring MVC之二 第21章 集成其他Web框架 第6篇 其他 第22章 Spring应用的测试 第23章 Spring工具类盘点 附录A 各种数据库连接...
工作中常用的远程调用请求工具类,支持请求方法:GET、POST、PUT、DELETE,支持媒体格式:text/plain、text/xml、application/json、application/x-www-form-urlencoded,支持请求协议:HTTP、HTTPS,该工具类直接可...
避免重复造轮子,开发中常用封装的工具类,包括:类型转换器,时间格式转换器,文件传输,非Controller中获取当前session的工具类,唯一id生成器,MD5加密类(封装jdk自带的md5加密方法),数字格式化的类,得到中文...