欢迎访问我的个人网站==》 jiashubing.cn
上一页 1 2 3 4 5 6 7 ··· 39 下一页
摘要: 有的时候啊,做定制化的项目,可以这么干,好用就行,别的管他呢。 String path = Thread.currentThread().getContextClassLoader().getResource("").getPath().replace("WEB-INF/classes/", "js 阅读全文
posted @ 2023-03-31 14:13 贾树丙 阅读(49) 评论(0) 推荐(0) 编辑
摘要: System.out.println(5 & (~1)); 比如,通过二进制位运算实现权限设置 newAuth.getAuthority() 为表示权限的数字,attEnum.getIndex() 指的是某一个权限的位数,代码如下 if(flag) { Long tmp = newAuth.getA 阅读全文
posted @ 2022-12-22 13:54 贾树丙 阅读(151) 评论(0) 推荐(0) 编辑
摘要: <dependency> <groupId>com.carrotsearch</groupId> <artifactId>java-sizeof</artifactId> <version>0.0.5</version> </dependency> import com.carrotsearch.s 阅读全文
posted @ 2022-12-22 10:44 贾树丙 阅读(1345) 评论(0) 推荐(0) 编辑
摘要: axios 方案,具体原理在网上搜索吧。我想要说的是,这种方法是有缺陷的。虽然写header是没问题的,但是返回值是一堆的 html。此时如果使用 document.write 就不能加载js,如果使用下面的方法,相当于打开了一个新窗口,可以加载js,但是url 地址没了 var form1 = d 阅读全文
posted @ 2022-12-22 10:24 贾树丙 阅读(4017) 评论(0) 推荐(0) 编辑
摘要: 很早之前的笔记了,现在想当时的场景,这么蠢的问题竟然还头疼了很长时间,说到底还是不愿尝试,以此为戒。 问题 IDEA 插件开发,在编写 .form 格式文件的时候,同时会展示一个Palette 面板, 有一套可视化的组件,都是一些基本元素,如下: 比如现在我想要的组件是 EditorTextFiel 阅读全文
posted @ 2022-12-20 17:11 贾树丙 阅读(471) 评论(0) 推荐(0) 编辑
摘要: 问题 比如 后端传了一个boolean类型的参数,js如果直接使用这个参数,比如这么写就是错的 if (${redevice}) { document.getElementById('redevice').checked = true; } 会报语法错:Uncaught SyntaxError: U 阅读全文
posted @ 2022-12-20 16:48 贾树丙 阅读(103) 评论(0) 推荐(0) 编辑
摘要: public static boolean isEmptyForOne(String...strings){ if(strings==null||strings.length==0) { return true; } for(String s : strings){ if(isEmpty(s)) { 阅读全文
posted @ 2022-12-20 16:35 贾树丙 阅读(50) 评论(0) 推荐(0) 编辑
摘要: IDEA2021已经过期,弹出了Licensed ,想把它关了然后装一个破解插件,结果它一关,整个软件都关了,想点【试用】都没这个按钮 坑死了,最后发现它不是不让点,是改成先登录帐号以后,才让点这个试用,然后就可以把 Licensed 窗口关了 阅读全文
posted @ 2022-09-27 15:15 贾树丙 阅读(898) 评论(0) 推荐(0) 编辑
摘要: 判断类 package config; import java.util.regex.Matcher; import java.util.regex.Pattern; public class CheckMobile { private CheckMobile() { } // \b 是单词边界(连 阅读全文
posted @ 2022-08-16 10:27 贾树丙 阅读(1338) 评论(0) 推荐(0) 编辑
摘要: function addScript(url){ var script = document.createElement('script'); script.setAttribute('type','text/javascript'); script.setAttribute('src',url); 阅读全文
posted @ 2022-07-28 14:35 贾树丙 阅读(730) 评论(0) 推荐(0) 编辑
摘要: 比如有 A、B两个服务,对应的域名不同,A服务引用了B服务的 js,B 服务读取了自己域名下的cookie,然后返回给A 服务,该如何实现。 代码其实也不复杂,这里只简单说一下原理。 A 服务定义一个方法,必须包含一个参数,比如: function successLogin(respon) { va 阅读全文
posted @ 2022-07-01 15:02 贾树丙 阅读(162) 评论(0) 推荐(0) 编辑
摘要: 有一个需求,同时给 cookie 设置过期时间Expires 和 Samesite 属性。Expires 为一个具体的时间,Samesite=none 失败过好多次,最后发现规律是: httpResponse.addHeader("Set-Cookie",cksb.toString()); Same 阅读全文
posted @ 2022-07-01 11:11 贾树丙 阅读(1895) 评论(0) 推荐(0) 编辑
摘要: 如果 cookie 里已经有了JSESSIONID ,那就可以从 request 中获取。 但是它是怎么来的呢?答:是在最开始生成会话的时候来的。那如果想要在生成的时候,就获取到JSESSIONID 该怎么做? 答:也是有方法的,在生成JSESSIONID 的时候,从 response 的 head 阅读全文
posted @ 2022-07-01 10:50 贾树丙 阅读(2467) 评论(0) 推荐(0) 编辑
摘要: 只要添加这个插件,打包的时候就会自动生成 git.properties 文件 <build> ... <plugin> <groupId>pl.project13.maven</groupId> <artifactId>git-commit-id-plugin</artifactId> </plug 阅读全文
posted @ 2022-07-01 10:39 贾树丙 阅读(472) 评论(0) 推荐(0) 编辑
摘要: public static void main(String[] args) { Object a = null; String b = (String) a; // 把null 进行类型强转是否会编译错误 System.out.println(b); // 输出为null boolean flag 阅读全文
posted @ 2022-07-01 10:35 贾树丙 阅读(269) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 ··· 39 下一页