Created
October 6, 2016 11:31
-
-
Save ufuk/28a3380ecb44d6003a0939a381759a8a to your computer and use it in GitHub Desktop.
To get the request and response objects in Spring MVC projects you can use this code
This file contains 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
ServletRequestAttributes servletRequestAttributes = (ServletRequestAttributes) RequestContextHolder.currentRequestAttributes(); | |
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