1、在Controller中使用ThreadLocal变量2、在spring配置文件Controller中声明 scope="prototype",每次都创建新的controller所在在使用spring开发web 时要注意,默认Controller、Dao、Service都是单例的。