摘要: 文件下载 1. 直接向response的输出流中写入对应的文件流 @GetMapping("/download1") @ResponseBody public String download1(HttpServletResponse response){ FileInputStream fileIn 阅读全文
posted @ 2022-09-09 13:14 panther125 阅读(96) 评论(0) 推荐(0) 编辑
摘要: 准备Vue.js环境 Java语言的程序包:jar包 JavaScript语言的程序包:外部js文件 对于Java程序来说,框架=jar包+配置文件。对于Vue来说,导入Vue的外部js文件就能够使用Vue框架了。 Vue框架的js文件获取 官网提供的下载地址:vue.js VUE2框架的官网 地址 阅读全文
posted @ 2022-08-31 22:44 panther125 阅读(127) 评论(0) 推荐(0) 编辑
摘要: 一、导入jar包 下载jar包 https://www.jb51.net/softs/546820.html 二、配置xml文件 <?xml version="1.0" encoding="UTF-8"?> <web-app xmlns="http://xmlns.jcp.org/xml/ns/ja 阅读全文
posted @ 2022-07-23 17:47 panther125 阅读(144) 评论(0) 推荐(0) 编辑
摘要: 一、 获取所有目录 public static class DeleteNullDirectory { public List getAllDirectorys(File root) { List list = new ArrayList(); File[] dirs = root.listFile 阅读全文
posted @ 2022-06-20 16:23 panther125 阅读(1119) 评论(0) 推荐(0) 编辑
摘要: 一、Cookie 1. 创建Cookie /** * 创建一个新的Cookie可同时创建多个 * @author: panther * @date: 2022/6/9 10:31 * @param: [req, resp] * @return: void **/ protected void cre 阅读全文
posted @ 2022-06-10 00:04 panther125 阅读(22) 评论(0) 推荐(0) 编辑
摘要: 一、HashMap底层实现 HashMap底层结构:数组+链表+红黑树 Java中的HashMap是以键值对(key-value)的形式存储元素的。HashMap需要一个hash函数,它使用hashCode()和equals()方法来向集合/从集合添加和检索元素。当调用put()方法的时候,Hash 阅读全文
posted @ 2022-04-29 12:12 panther125 阅读(28) 评论(0) 推荐(0) 编辑
摘要: UDP聊天案例 1.分别建立一个接受端作为聊天内容的接收,创建多个客服端发送信息 接受端 public static void main(String[] args) throws IOException { //定义一个指定端口的接收端对象,开放端口接受数据 DatagramSocket serv 阅读全文
posted @ 2022-04-25 12:01 panther125 阅读(28) 评论(0) 推荐(0) 编辑
摘要: UDP Inetaddress常用方法 方法声明 功能描述 InetAddress getByName(String host) 获取指定主机的IP地址 InetAddress getLocalHost() 获取本地主机地址 String getHostName() 获取本地主机的主机名 boole 阅读全文
posted @ 2022-04-25 11:45 panther125 阅读(43) 评论(0) 推荐(0) 编辑
摘要: 一、同步代码块 lock是一个锁对象,它是同步代码块的的关键 class myThread2 implements Runnable{ private int tickets =10; private final Object lock = new Object();//任意对象类型 @Overri 阅读全文
posted @ 2022-04-24 12:05 panther125 阅读(35) 评论(0) 推荐(0) 编辑
摘要: 一、创建多线程的方法 1.通过继承Thread类实现多线程 class myThread extends Thread{ public myThread(String name){ super(name); } @Override public void run() { int i=0; while 阅读全文
posted @ 2022-04-23 20:37 panther125 阅读(54) 评论(0) 推荐(0) 编辑