https://www.cnblogs.com/coshaho/p/5127135.htmlhtml
// ThreadLocal裏只存儲了簡單的String對象,也能夠本身定義對象,存儲更加複雜的參數
private static ThreadLocal<String> threadLocal = new ThreadLocal<String>();post
public static String getPostRequestParams(){
return threadLocal.get();
}htm
public static void setPostRequestParams(String postRequestParams){
threadLocal.set(postRequestParams);
}對象
public static void removePostRequestParams(){
threadLocal.remove();
}blog