All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.fhs.pagex.context.PagexServletContext Maven / Gradle / Ivy

The newest version!
package com.fhs.pagex.context;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class PagexServletContext {
    private static ThreadLocal requestThreadLocal = new ThreadLocal<>();
    private static ThreadLocal responseThreadLocal = new ThreadLocal<>();

    public static void init(HttpServletRequest req,HttpServletResponse resp){
        requestThreadLocal.set(req);
        responseThreadLocal.set(resp);
    }

    public static HttpServletRequest getRequest(){
        return requestThreadLocal.get();
    }

    public static HttpServletResponse getResponse(){
        return responseThreadLocal.get();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy