当前位置:网站首页>【Utils】ServletUtil
【Utils】ServletUtil
2022-07-28 13:12:00 【一鸭一鸭唷】
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
public class ServletUtil {
public static HttpServletRequest getRequest(){
return ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
}
public static HttpServletResponse getResponse(){
return ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getResponse();
}
}
边栏推荐
- Holes in [apue] files
- Istio IV fault injection and link tracking
- SQL daily practice (Niuke new question bank) - day 4: advanced operators
- Tutorial on the principle and application of database system (062) -- MySQL exercise questions: operation questions 32-38 (6)
- 关于栈的理解以及实际应用场景
- Chapter 6 support vector machine
- R语言ggplot2可视化:使用ggpubr包的ggviolin函数可视化小提琴图、设置palette参数自定义不同水平小提琴图的边框颜色
- No swagger, what do I use?
- es6你用过哪些惊艳的写法
- Record a fake login of cookie
猜你喜欢

Socket class understanding and learning about TCP character stream programming

在 Kubernetes 中部署应用交付服务(第 1 部分)

Implementation of StrCmp, strstr, memcpy, memmove

安全保障基于软件全生命周期-Istio的认证机制

111. The sap ui5 fileuploader control realizes local file upload and encounters a cross domain access error when receiving the response from the server

Diablo 4 ps4/ps5 beta has been added to the Playstation database

Jmeter安装教程及登录增加token

SLAM论文合集

No swagger, what do I use?

安全保障基于软件全生命周期-Istio的授权机制
随机推荐
【飞控开发基础教程7】疯壳·开源编队无人机-SPI(气压计数据获取)
Poj1860 currency exchange solution
Qt5开发从入门到精通——第一篇概述
7. Dependency injection
What is the reason why the words behind word disappear when typing? How to solve it?
在 Kubernetes 中部署应用交付服务(第 1 部分)
Long closed period private placement products reappearance industry insiders have different views
111. The sap ui5 fileuploader control realizes local file upload and encounters a cross domain access error when receiving the response from the server
After finishing, help autumn move, I wish you call it an offer harvester
Postgresql14 installation and master-slave configuration
你真的了解esModule吗
Poj3268 shortest path solution
R language ggplot2 visualization: visualize the scatter diagram and add text labels to the data points in the scatter diagram, using geom of ggrep package_ text_ The rep function avoids overlapping da
30天刷题计划(三)
Dojp1520 gate jumping problem solution
线程阻塞的三种情况。
P1797 heavy transportation problem solution
On websocket
Security assurance is based on software life cycle -istio authentication mechanism
Graph traversal (BFS & DFS basis)