Last active
May 12, 2023 03:35
-
-
Save sandipchitale/d124b46f911975faacb68028f911a721 to your computer and use it in GitHub Desktop.
Get hold of current request #spring-web-mvc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RequestAttributes requestAttributes = RequestContextHolder.getRequestAttributes(); | |
if (requestAttributes instanceof ServletRequestAttributes servletRequestAttributes) { | |
HttpServletRequest httpServletRequest = servletRequestAttributes.getRequest(); | |
HttpServletResponse httpServletResponse= servletRequestAttributes.getResponse(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment