Error Handling with Exceptions The ideal time to catch an error is at compile time, before you even try to run the program. The rest of the problems must be handled at run time through some formality that allows the originator of the error to pass ap…
SpringMVC:学习笔记(12)——ThreadLocal实现会话共享 ThreadLocal ThreadLocal,被称为线程局部变量.在并发编程的情况下,使用ThreadLocal创建的变量只能被当前线程访问,其他线程则无法访问和修改.每个Thread对象内部都维护了一个ThreadLocalMap它可以存放若干个ThreadLocal.如下为Thread源码部分: /* ThreadLocal values pertaining to this thread. This map is…