当前位置:网站首页>【Utils】ServletUtil
【Utils】ServletUtil
2022-07-28 14:10:00 【One duck, one duck】
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();
}
}
边栏推荐
- IP黑白名单
- Socket class understanding and learning about TCP character stream programming
- 30 day question brushing plan (IV)
- Understanding of "image denoising using an improved generic advantageous network with Wasserstein distance"
- 【Utils】ServletUtil
- jenkins
- Thoroughly master binary search
- Graph traversal (BFS & DFS basis)
- 算法---不同路径(Kotlin)
- 安全保障基于软件全生命周期-NetworkPolicy应用
猜你喜欢

30 day question brushing plan (II)

DXF reading and writing: align the calculation of the position of the dimension text in the middle and above

Socket类关于TCP字符流编程的理解学习

7. Dependency injection

解决uniapp微信小程序canvas不能引入字体的问题

【LVGL事件(Events)】事件在不同组件上的应用(一)

Record a fake login of cookie

第六章 支持向量机

Implementation of StrCmp, strstr, memcpy, memmove

Clickhouse分布式集群搭建
随机推荐
Three cases of thread blocking.
R语言ggplot2可视化:使用ggpubr包的ggviolin函数可视化小提琴图、设置draw_quantiles参数添加指定分位数横线(例如,50%分位数、中位数)
【服务器数据恢复】HP StorageWorks系列服务器RAID5两块盘离线的数据恢复
Discrete logarithm problem (DLP) & Diffie Hellman problem (DHP)
webSocket聊天
QT自制软键盘 最完美、最简单、跟自带虚拟键盘一样
【Utils】ServletUtil
IP黑白名单
[lvgl events] Application of events on different components (I)
Several solutions to spanning
redis哨兵机制
7. Dependency injection
Rust from introduction to mastery 01 introduction
Long closed period private placement products reappearance industry insiders have different views
Operator3 - design an operator
Clickhouse架构与设计
作为一个程序员,如何高效的管理时间?
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
Redis sentinel mechanism
IntersectionObserver交叉观察器