当前位置:网站首页>【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();
}
}
边栏推荐
- DXF reading and writing: Chinese description of dimension style group codes
- 7. Dependency injection
- IntersectionObserver交叉观察器
- 论文研读--Masked Generative Distillation
- 软件测试技术之如何编写测试用例
- R language uses LM function to build linear regression model and subset function to specify subset of data set to build regression model (use floor function and length function to select the former pa
- A label_ File download (download attribute)
- 《机器学习》(周志华) 第6章 支持向量 学习心得 笔记
- What is the reason why the words behind word disappear when typing? How to solve it?
- Qt5 development from introduction to mastery -- the first overview
猜你喜欢

安全保障基于软件全生命周期-PSP应用

第六章 支持向量机

多级缓存方案

Operator3 - design an operator

redis哨兵机制

30 day question brushing plan (III)
![[basic course of flight control development 7] crazy shell · open source formation UAV SPI (barometer data acquisition)](/img/ad/e0bc488c238a260768f7e7faec87d0.png)
[basic course of flight control development 7] crazy shell · open source formation UAV SPI (barometer data acquisition)

Machine learning (Zhou Zhihua) Chapter 6 notes on Support Vector Learning

30 day question brushing plan (IV)

【LVGL事件(Events)】事件在不同组件上的应用(一)
随机推荐
R language ggplot2 visualization: use the ggviolin function of ggpubr package to visualize violin diagrams, set the palette parameter, and customize the border colors of violin diagrams at different l
30天刷题计划(三)
解决跨越的几种方案
Uva11175 digraph D and E from D to e and back
Clickhouse架构与设计
DXF reading and writing: Chinese description of dimension style group codes
[basic course of flight control development 7] crazy shell · open source formation UAV SPI (barometer data acquisition)
牛客多校-Link with Level Edito I-(线性dp)
DXF读写:标注样式组码中文说明
ES6 what amazing writing methods have you used
Poj1860 currency exchange solution
Several efficient APIs commonly used in inventory operation URL
软件测试技术之如何编写测试用例
IP黑白名单
盘点操作URL中常用的几个高效API
SQL daily practice (Niuke new question bank) - day 4: advanced operators
Deploy application delivery services in kubernetes (Part 1)
走进音视频的世界——FLV视频封装格式
The strongest distributed locking tool: redisson
什么是自旋锁 自旋锁是指当一个线程尝试获取某个锁时,如果该锁已被其他线程占用,就一直循环检测锁是否被释放,而不是进入线程挂起或睡眠状态。 /** * 为什么用自旋锁:多个线程对同一个变量