- 浏览: 4843 次
- 性别:
- 来自: 苏州
最新评论
文章列表
常用集合的默认初始容量和扩容的原因:
当底层实现涉及到扩容时,容器或重新分配一段更大的连续内存(如果是离散分配则不需要重新分配,
离散分配都是插入新元素时动态分配内存),要将容器原来的数据全部复制到新的内存上,这无疑使效率
大大降低。
加载因子的系数小于等于1,意指 即当 元素个数 超过 容量长度*加载因子的系数 时,进行扩容。另外,扩容也是有默认的倍数的,不同的容器扩容情况不同。
List 元素是有序的、可重复
ArrayList、Vector默认初始容量为10
Vector:线程安全,但速度慢
底层数据结构是数组结构
加载因子为1:即当 元 ...
sts按照testng
- 博客分类:
- sts testng
Using the dropins folder is not recommended. Go to help -> Install new software. In the Work with text box, use this URL: http://beust.com/eclipse
Could not get configured mojo for org.apache.maven.plugins:maven-checkstyle-plugin:2.17:checkstyle {execution: checkstyle}Plugin org.apache.maven.plugins:maven-checkstyle-plugin:2.17 or one of its dependencies could not be resolved: Could not find artifact com.sun:tools:jar:1.7.0 at specified path ...
吗的,今天又手贱了。
An internal error occurred during: "Building workspace".GC overhead limit exceeded
-Xms512m-Xmx1024m-XX:PermSize=512m-XX:MaxPermSize=1024m
记录一下使用openfire开发即时通讯时遇到的问题:
1、安装openfire;
2、使用smack类库连接openfire:
在连接的时候如果报错如下:
Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
说明你需要按照openfire的证书。
安装证书方法:
参考https://issues.jenkins-ci.org/browse/JENKINS-2 ...
HttpSession session = request.getSession(false);
1、用户第一次请求登录,要先将还存在服务器端的session置为无效:
if(session != null)
session.invalidate();
然后生成session:
session = request.getSession();
可以设置隔多长时间不操作session就删除session:
session.setMaxInactiveInterval(60 * 60);
response.setStatus(401);response.setHeader(& ...
spring的filter代理
- 博客分类:
- spring
单元测试里测试controller,有的接口需要用户登录,登录的处理是在filter里更具请求过来的token进行解析后验证,这里需要加filter放到spring容器里,通过org.springframework.web.filter.DelegatingFilterProxy实现。
maven常见问题记录
- 博客分类:
- maven
1、打包命令:mvn package -P xxx
2、[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.5.1:compile (default-compile) on project migumoa: Fatal error compiling: tools.jar not found: D:\JAVA\JDK\jre7\..\lib\tools.jar -> [Help 1]提示这个错误的话,将JAVA_HOME/lib/tools.jar移动到jre7/lib下