![](https://img-blog.csdnimg.cn/20201014180756757.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Java
hello_yajing
正在努力的程序猿一枚!
展开
-
下载文件--接口
@RequestMapping(value = "download",method = RequestMethod.GET) public ResponseEntity<byte[]> download(HttpServletResponse response, HttpServletRequest request) throws Exception{ //预下载文件路径****** String preDownload_path = "//172.1.原创 2020-07-06 11:22:45 · 1303 阅读 · 0 评论 -
Linux下的JDK安装笔记
1.本地下载jdk:jdk下载2.rz命令,上传至服务器 /usr/local/src(第一次传输失败,第二次就可以了)3.解压:tar -zxvf jdk-8u251-linux-x64.tar.gzmkdir /usr/local/java1.8mv /usr/local/src/jdk-8u251-linux-x64 /usr/local/java1.84.配置环境变量vim /etc/profileexport JAVA_HOME=/usr/local/.原创 2020-06-17 11:31:29 · 119 阅读 · 0 评论 -
2020-01-09 @Autowired注解抛异常: java.lang.NullPointerException
出现这个问题的原因有以下几点:一:配置文件1.applicationContext.xml要开启注解支持!扫描器路径不要写错咯!```java<?xml version="1.0" encoding="UTF-8"?><beans xmlns="http://www.springframework.org/schema/beans" xmlns:cont...原创 2020-04-10 17:54:17 · 389 阅读 · 1 评论 -
Java 字符串操作-----自学总结(待更新)
1.字符串的indexOf()方法#下标从0开始//返回第一次出现的指定子字符串在此字符串中的索引。int res = longStr.indexOf(shortStr) //从指定的索引处开始,返回第一次出现的指定子字符串在此字符串中的索引。int res = longStr. indexOf(shortStr, int startIndex)//返回在此字符串中最右边出现的指定子字符串的索引。int res = longStr.lastIndexOf(shortStr)...原创 2020-06-16 17:53:42 · 134 阅读 · 0 评论 -
java 异常理解
一、异常分类Java把异常当做对象来处理。Throwable是所有错误或异常的超类。Throwable类有两个直接子类:Error类和Exception类。1、Error是指java运行时系统的内部错误和资源耗尽错误,是程序无法处理的异常,应用程序不会抛出该类对象。2、Exception是程序本身可以处理的异常,应尽可能去处理这些异常。Exception分两类,一个是运行时异常RuntimeException,一个是检查异常CheckedException。3、CheckedException转载 2020-05-18 14:24:03 · 94 阅读 · 0 评论