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

com.xqbase.util.servlet.Servlets Maven / Gradle / Ivy

There is a newer version: 0.2.18
Show newest version
package com.xqbase.util.servlet;

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

public class Servlets {
	static ThreadLocal local = new ThreadLocal<>();

	ServletContext context;
	HttpServletRequest request;
	HttpServletResponse response;

	public static ServletContext getContext() {
		Servlets servlets = local.get();
		return servlets == null ? null : servlets.context;
	}

	public static HttpServletRequest getRequest() {
		Servlets servlets = local.get();
		return servlets == null ? null : servlets.request;
	}

	public static HttpServletResponse getResponse() {
		Servlets servlets = local.get();
		return servlets == null ? null : servlets.response;
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy